RES: [PEAR-DEV] DataObjects insert() for pgsql

From: Date: Mon, 06 Oct 2003 18:45:37 +0000
Subject: RES: [PEAR-DEV] DataObjects insert() for pgsql
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22413@lists.php.net to get a copy of this message
When we don't specify the sequencial key in insert, postgresql automaticaly generates the next id. But, if you need the id created in a concurrent transaction, in the way that the DataObject came, it was not possible to know preciselly this id. I need a insert method that returns this id. My version of the insert method, transparently, find out the sequence name of the id column. After, it generates the next id and then, inserts the record with that id. Finally, returns the id. Thanks, Rodrigo Carvalho Rezende toGO Ltda. -----Mensagem original----- De: Markus Wolff [mailto:wolff@21st.de] Enviada em: segunda-feira, 6 de outubro de 2003 14:45 Para: Rezende Rodrigo Cc: pear-dev@lists.php.net; Matsushita Wagner Assunto: Re: [PEAR-DEV] DataObjects insert() for pgsql Rezende Rodrigo wrote: > Hello > > Actually the insert method in DataObjet suport only Mysql and Mssql (CVS). > Bellow is sugestion for insert method (postgresql) Just curious, why does Postgres need a special treatment here? After all, MySQL and MSSQL are treated differently just because they don't have native support for sequences, so AUTO_INCREMENT / IDENTITY is used. AFAIK, Postgres has no problems with sequences, so why do anything else? CU Markus

« previous php.pear.dev (#22413) next »