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

Request #9106 More accurate sequence name
Submitted: 2006-10-20 13:13 UTC
From: mcraig at leadehealth dot com Assigned: quipo
Status: Closed Package: MDB2 (version 1.2.2)
PHP Version: 4.4.3 OS: linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-10-20 13:13 UTC] mcraig at leadehealth dot com (Matt Craig)
Description: ------------ This request is for the driver to do a little more introspection in getSequenceName in order to return a more accurate sequence name. For instance, right now it does not check the tableInfo for SERIAL sequences created by PostgreSQL. It just returns something like "<table>_seq", whereas it should have the ability to look for a column definition containing "nextval(.*)". Through something: // pgsql.php / override getSequenceName function getSequenceName($sqn) { $ti = $this->reverse->tableInfo($sqn); ... grab the col & parse the nextval(); if($found) return $seqnname; return parent::getSequenceName($sqn); } Expected result: ---------------- For example, I use DB_DataObject to access a table called "enrollment" with a sequence called "enrollment_id_seq" that was created by Postgres. My current version of DB_DataObject (via DB, actually) creates and returns a seqeuence named "enrollment_seq" so that when non-PHP programs access the table and use the real sequence there are id collisions. It would be great if MDB could return the real sequence to avoid these collisions.

Comments

 [2006-10-20 14:06 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-10-25 11:54 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-10-30 17:15 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-11-02 13:55 UTC] mcraig at leadehealth dot com
pg_get_serial_sequence does not seem to be included by default on the latest gentoo postgres 7.4.13, though it is in version 8. Also it still requires introspection to know exactly which column is expected to be the serial column.
 [2007-04-27 16:28 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!