ZF-12062: Postgresql: schema isn't included in the sequence when explicitly setting it


I have a table 'AssetType' for which the PK uses a sequence called "AssetTypePk_seq", both of which are located in the 'data' schema.

Now when I create concrete implementation of the Zend_Db_Table_Abstract class with $_sequence set to 'AsetTypePk_seq' each insert will fail because Zend_Db_Adapter throws an error that the relation/table for the sequence can't be found.

I've tracked it down to the nextSequenceId method in Zend_Db_Adapter_Pgsql which doesn't take in account the defined schema on the Zend_Db_Table. When just setting the $_sequence property to true (thus auto generating the sequence table name) the schema gets added but the sequence table name isn't correct since it's created using the PK name (which in my case isn't in the sequence name).

tl;dr Whe should be able to either add the schema explicitly to the $_sequence property of Zend_Db_Table or it should add it automatically when calling nextSequenceId() on the pgsql adapter.


No comments to display