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

Bug #2068 sequence problem when another unique index exists
Submitted: 2004-08-05 14:05 UTC
From: daniel at konczyk dot net Assigned: alan_k
Status: Closed Package: DB_DataObject
PHP Version: 4.3.4 OS: Debian GNU/linux
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 : 37 + 27 = ?

 
 [2004-08-05 14:05 UTC] daniel at konczyk dot net
Description: ------------ I use the latest DB_DataObject This is postgresql issue, here how it looks here and why it doesn't work: I have a table with 4 columns, id, col1, col2, col3 id has default value nextval('sometable_seq') + primary_key flag I have a multiple unique index on the rest 3 columns Generator treats all the 4 columns as KEYS, and so mark them as K in the database.ini file. The rusult of the insert query on that table is 'No Data specified for query' If I drop the unique index, everythig works fine Isn't that a mistake, that the columns are treated as Keys, although if I've already specified table's primary key...?

Comments

 [2004-08-06 12:36 UTC] naveen at dittakavi dot com
Hi Daniel, That's funny. I just ran into this same issue. I spent about an hour looking into it and see that we must override sequenceKey() in our DB_tablename file to return array(false, false). Here's our fix: class DataObjects_"tablename" extends DB_DataObject { #autocode ... #end autocode function sequenceKey() { return array(false, false); }//end function }//end class You'll need to do this for each class that you have already defined a sequence and have set the default value nextval for. Let me know if this doesn't help. - Naveen
 [2004-08-07 02:11 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-08-09 15: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-08-10 00:09 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!