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

Bug #135 DB_pgsql: invalid replacing of sequence names
Submitted: 2003-10-22 07:54 UTC
From: rene at osta dot ee Assigned: danielc
Status: Closed Package: DB
PHP Version: 4.3.3 OS: Linux RH9
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 39 - 28 = ?

 
 [2003-10-22 07:54 UTC] rene at osta dot ee
Description: ------------ DB_pgsql::getSequenceName behaves incorrectly by replacing /[^a-z0-9_]/i (all but numbers and letters) with _. This disables using of schemas in postgresql. sequences in other schemas are accessed by schemaname.sequencename. The . will be replaced with _ and incorrect sequence name is used when querying nextval(). Actually DB_pgsql inherits this methid from DB_common. If this is no problem for other DB engines DB_pgsql should define it's own getSequenceName, which at least does not replace dots in sequence names. It should also be considered that ANSI SQL allows also spaces in schema, table, sequence, ... names for example "My Schema"."My Sequence" Reproduce code: --------------- for example: $DBC = DB::connect(....); $DBC->setOption('seqname_format','%s'); $next_id = $DBC->nextId('myschema.mysequence'); Expected result: ---------------- $next_id should be the next value from mysequence in myschema Actual result: -------------- actually DB creates a new sequence named myschema_mysequence (if it does not exiost already) and selects it's nextval.

Comments

 [2004-01-15 19:52 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!
 [2004-06-07 13:20 UTC] sintemaa at hotmail dot com
Where has this fix gone. In which version of which file in CVS it has been fixed, cause I can not find the fixed file in CVS, and I have the same problem in DB with oci8 backend.
 [2004-06-07 13:38 UTC] sintemaa at hotmail dot com
Never mind I had a different problem (no permission to read sequences in another schema)