logo       

lastInsertId and Postgres: msg#00000

Subject: lastInsertId and Postgres
Hi all,

I'm running Postgres 8.1, PHP 5.2 and ZF 0.2.0 and I'm having trouble with calling lastInsertId after insert. I've done as instructed at http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.insert however I get the following error

Uncaught exception 'PDOException' with message 'SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "__seq" does not exist'

I also have piece of older code which uses Zend_Db_Table to operate inserts and this works. However, in ZF general list I remember reading that using it is slower and should be avoided. So my questions are, is there something wrong with Postgres settings as it claims sequence does not exists when it in fact does (there's a column with SERIAL) and how should I get the new sequence id?

Thanks!

--
Teemu Valimaki <teemu.valimaki-X3B1VOXEql0@xxxxxxxxxxxxxxxx>



<Prev in Thread] Current Thread [Next in Thread>