Re: sequences implementation for DB/pgsql

From: Date: Wed, 13 Dec 2000 16:53:58 +0000
Subject: Re: sequences implementation for DB/pgsql
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-683@lists.php.net to get a copy of this message
DB_pgsql and DB_mysql both use db_seq_${name} now. I think that's a good standard. - Stig Peter Bowen wrote: > > Should we be setting a default standard for sequences? If we > specify an append of _seq for all sequences, then don't we break > compatibility with current databases, and make life very hard for those > who use other languages to connect to the same database? > > Thanks. > Peter > > On Wed, 13 Dec 2000, Stig S. Bakken wrote: > > > Alexey Borzov wrote: > > > > > > Greetings! > > > > > > I've decided to give PEAR::DB a test and immediately noticed > > > that DB_pgsql lacks sequence support. > > > So I copied an implementation from DB_mysql and redone it for native > > > Postgres sequences. > > > The functions are tested and work as intended: > > > 1) if a sequence exists, nextId is returned, > > > 2) if it doesn't exist - it gets created, > > > 3) if it cannot be created - an error is returned (I tested with the > > > sequence names that begin with 'pg_' prefix, which is reserved for > > > system catalogs). > > > The functions are formatted in accordance with the "latest > > > standard", PHPDoc comments are added, blah-blah-blah > > > So you can just commit them into CVS. ;] > > > > Hi Alexey, > > > > I have sequences implemented in my local checkout, but I rewrote some > > error handling stuff at the same time that broke a few tests, so it's > > not committed yet. :-) I didn't append "_seq" to the actual sequence > > names though, it's probably a good idea, so I'll add that. Thanks. > > > > - Stig > > > >

« previous php.pear (#683) next »