Re: Postgresql indices (was Re: lisp mail archive software)

Peter Seibel <[email protected]> 07 Jul 2003 12:43:56 -0700
Newsgroups gmane.lisp.clump
Message-ID <[email protected]>
Miles Egan <[email protected]> writes:

> 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...

Have you looked at BerkeleyDB? If all you need is a way to reliably
store certain data on disk and do simple lookups it might be a more
lightweight solution. I don't know of any Lisp bindings for it but it
should be possible to access via an FFI wrapper. (Which is what, the
Perl, Python, and Java libraries do.)

It's much more administratively lightweight than a full-on RDBMS but
more robust and efficient than just a bunch of flat files. Of course
if you want to do ad-hoc queries, you'll ultimately end up
reimplementing an RDBMS on top of it.

-Peter

-- 
Peter Seibel                                      [email protected]

         Lisp is the red pill. -- John Fraser, comp.lang.lisp