Re: Postgresql indices (was Re: lisp mail archive software)
Miles Egan <[email protected]> Mon, 07 Jul 2003 07:45:08 -0700
| Newsgroups | gmane.lisp.clump |
|---|---|
| Message-ID | <[email protected]> |
Zachary Beane wrote: >>Isn't that potentially racey? What happens if another user does an >>insert between when you do yours and when you call currval? > > > This is a Postgres FAQ, and the answer is no. 'currval' is tracked per > session so you'll always get the result of your own most-recent > 'nextval', not someone else's. This is what my original question was about. I knew postgres did this but I wasn't sure if it did it server-side or somewhere in the client libs. After thinking about it for a while last night, it seems like it would have to be done server side and anything that uses the pg protocol to talk to a db server should get this for free. Right? Still trying to figure out a way to avoid using a db at all for this... miles