Re: Pear DB LastInsertID

From: Date: Fri, 12 Jul 2002 09:35:22 +0000
Subject: Re: Pear DB LastInsertID
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1864@lists.php.net to get a copy of this message
Martin Tsachev skrev:
Is it an advantage when you want to use something like MySQL's auto_increment/PostgreSQL's SERIAL (PostgreSQL also supports sequences though).
It sounds like you believe that SERIAL is like MySQL's auto_increment, and the alternative is to use sequences. It's not like that. PostgreSQL's SERIAL uses sequences - it's not the same as MySQL's auto_increment. When you specify SERIAL for a column, the following things happen: - A sequence named tablename_seq is created (that is, a separate table for the sequence is made). - The column data type becomes INTEGER. - A primary key (NOT NULL + UNIQUE) is made for the column.

« previous php.pear.general (#1864) next »