Thread: pgAdminII support question

pgAdminII support question

From
David Leikis
Date:
<div class="Section1"><p class="MsoNormal">I am trying to create auto-incrementing of the Primary Key within each
recordby using sequences.<p class="MsoNormal"> <p class="MsoNormal">Sometimes I can get the “add – sequence” to work by
creatingit with the name “tablename_columnname_seq”.<p class="MsoNormal"> <p class="MsoNormal">There are many other
timesthat this doesn’t work.  (The table create SQL doesn’t show up with the ‘serial’ command word in the column
creation.)<pclass="MsoNormal"> <p class="MsoNormal">The sequence name is there, but it doesn’t seem to ‘make
connection’to that table/column.<p class="MsoNormal"> <p class="MsoNormal">I am using pgAdmin version 1.8.4 and
PostGresversion 8.3 in Winxp setting.<p class="MsoNormal"> <p class="MsoNormal">Some solution to this would be very
helpful,please.<p class="MsoNormal"> <p class="MsoNormal">Dave Leikis</div> 

Re: pgAdminII support question

From
Guillaume Lelarge
Date:
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