Le 07/12/2009 18:09, David Leikis a écrit :
> I am trying to create auto-incrementing of the Primary Key within each record by using sequences.
>
> Sometimes I can get the "add - sequence" to work by creating it with the name "tablename_columnname_seq".
>
> There are many other times that this doesn't work. (The table create SQL doesn't show up with the 'serial' command
wordin the column creation.)
>
> The sequence name is there, but it doesn't seem to 'make connection' to that table/column.
>
> I am using pgAdmin version 1.8.4 and PostGres version 8.3 in Winxp setting.
>
> Some solution to this would be very helpful, please.
>
Usually, you should use the serial datatype. It'll automatically create
a sequence and link it to your column default value.
--
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com