PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #6790

ignore_sequence_keys = ALL is ignored

Details

Submitted2006-02-15 12:04 UTC
Frombruno at lustosa dot net
StatusNo Feedback
PackageDB_DataObject
PHP Version5.1.1
OSLinux
Roadmaps(Not assigned)

Comments

[2006-02-15 12:04 UTC] bruno at lustosa dot net

Description:
------------
Hello.

I'm using DataObjects with PostgreSQL, and have found a small problem in the insert() method.
I have these set at the config file:

ignore_sequence_keys = ALL
sequence_financa.moeda = id_moeda

I have one sequence_* for each table with a serial key, because createTables.php doesn't set the keys correctly in database.ini (in fact, it doesn't even set them).
I also had to write methods keys() and sequenceKey() for each of the class files it generated, because it wasn't getting them correctly (problems when trying to call update() - wasn't using the key). The sequenceKey() and keys() methods are basically this:

public function sequenceKey() {
return Array('id_moeda',false, financa.moeda_id_moeda_seq');
}

public function keys() {
return Array( "id_moeda" );
}

So, I'm telling it to use that specific sequence table, because of a known bug where it wouldn't determine the correct table correctly in postgres (bug 3773 here).
Now, all generated INSERT queries get the serial key set explicitly, which is not what I want. I wanted it to insert the values, and let the database generate the key for it.
According to the documentation, using 'ignore_sequence_keys' is the correct way to do it.
Is this a known bug or is this a misconfiguration?

PS: Bug #57 is very similar to this, but I can't post a comment there because the captcha script doesn't work, and so I can't send)