Multiple database support

David Miller justdave at syndicomm.com
Mon Sep 1 22:13:12 UTC 2003


On 9/2/2003 12:04 AM +0200, Jeroen Ruigrok/asmodai wrote:

> David,
>
> -On [20030901 03:52], David Miller (justdave at syndicomm.com) wrote:
>>Yeah, I'm still intending to use something like that here.  It seemed to
>>work very well at keeping the Sybase port running on both Sybase and MySQL
>>simultaneously.
>
> I added the necessary PostgreSQL extentions to it and placed it under
> the bug # at
> http://mecha.mozilla.org/attachment.cgi?id=130751&action=view
>
> I haven't tested it yet, but PostgreSQL requires correct ANSI SQL '
> placement.  Furthermore, one thing I cannot easily provide is the
> LAST_INSERT_ID()/@@identity stuff.  PostgreSQL requires use of its
> sequences for that and I'd reckon Oracle does as well (need to check).
>
> What do we use it for anyway?

Getting the just-created key number for the record inserted by the previous
INSERT statement (assuming the table has an auto_increment column in it).

We ended up not using @@identity on the Sybase port - Sybase's
implementation of it sucks, and it's not reliable, so we created a new
table to hold key numbers and do the lock/increment/select/unlock on the
appropriate row in that table to get key numbers (which means retrieving a
new key prior to doing an insert, and including the key in the insert
statement).
-- 
Dave Miller      Project Leader, Bugzilla Bug Tracking System
http://www.justdave.net/             http://www.bugzilla.org/



More information about the developers mailing list