Re: [Patch] DB_DataObject and Postgres INSERT race conditionobtaininglast key

From: Date: Wed, 18 Oct 2006 07:13:20 +0000
Subject: Re: [Patch] DB_DataObject and Postgres INSERT race conditionobtaininglast key
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-44615@lists.php.net to get a copy of this message
Alan Knowles wrote:
the issue is slightly different from the original thread. not knowing MDB2, you may have solved it. but here goes the summary: DataObjects needs to know the sequence name for a table, so it can fetch the last inserted id. in the old PEAR::DB world, it called getSequenceKey($table), which usually just returned the tablename, reformatted with %s_seq (from what I remember). However, in the brave new world of MDB2, The hope is that getSequenceKey($table) would actually use something like tableInfo(), look at the flags, and return the 'real' sequence key', as defined by nextval() etc.
You are talking about finding a nextval() trigger on a column? I think it would be wiser to let users configure that, no? Anyways if you do the following you should already get this information: $mdb2->reverse->tableInfo($table_name); regards, Lukas

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