If you define the sequence name yourself, try using the "lastSequenceId()"
method, and pass the name of the sequence as the argument to that method.
Regards,
Bill Karwin.
Jan Pieper wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
> I tried to use Zend_Db with PDO_PGSQL. After inserting a new row to
> database i try to get last insert id by lastInsertId() method but I even
> get bool(false). My tables create statement:
>
> CREATE SEQUENCE seq_article_id;
> CREATE TABLE article (
> article_id integer NOT NULL DEFAULT nextval('seq_article_id')
> PRIMARY KEY
> ...
> );
>
> PostgreSQL's manual says, that SERIAL is an autoincrementing integer,
> but i read that is the same as above (~helper).
>
> So, what i have todo to get a valid last insert id from lastInsertId()?
> Could it be that the sequence name must have a specific name? In
> Example: <table_name>_<column_name>_seq? I actually define the sequence
> name by myself.
>
> - -- Jan
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
>
> iD8DBQFHdPCdd3s9o1H9MZ4RA42tAJ9DGYzn0HD3ec4udDLiOql9dU6erACgjK26
> cVk+M0YVmAruY7Zbm1EDk1c=
> =PJQn
> -----END PGP SIGNATURE-----
>
>
--
View this message in context:
http://www.nabble.com/-PDO_PGSQL--lastInsertId%28%29-returns-bool%28false%29-tp14525474s16154p14541151.html
Sent from the Zend Framework mailing list archive at Nabble.com.