Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Request #9762 Field default sequence lookup
Submitted: 2007-01-08 05:31 UTC
From: aharvey Assigned: quipo
Status: Closed Package: MDB2_Driver_pgsql (version CVS)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2007-01-08 05:31 UTC] aharvey (Adam Harvey)
Description: ------------ (This is a restatement of DB request #97 for MDB2, originally reported by alan_k.) This feature would allow MDB2_Driver_pgsql::nextId() to be able to look up the next value of a sequence based the default value (defined using NEXTVAL) of a field, rather than the sequence name. Test script: --------------- As an example, if the following database schema was created: CREATE SEQUENCE seq; CREATE TABLE tab (num INTEGER DEFAULT NEXTVAL('seq')); and nextId was now defined as nextId($seq_name, $ondemand = true, $table = null, $field = null), then: $seqVal = $dbh->nextId(null, false, 'tab', 'num'); would return NEXTVAL('seq'), as it is the default value for tab.num. Expected result: ---------------- NEXTVAL('seq')

Comments

 [2007-03-12 12:59 UTC] quipo (Lorenzo Alberton)
Can't you just set 'seqname_format' to '%s' and call nextID() as usual?
 [2007-05-03 13:41 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.