[SQL] Function to reset sequence.....

2006-10-27 Thread Doug Hyde
I am a real newbie with PL/pgSQL, and with postgres, but here goes. The problem: when you import data into postgresql, there is no way to set the proper sequence on the primary key. For example, I could have a table with 2000 rows, some of which have been added/deleted in time, so the nextval for

[SQL] How to autoincrement a primary key...

2006-09-22 Thread Doug Hyde
I am sure this is simple, but I don't get it. I am new to PGSQL, coming from MySQL - in mysql, you can autoincrement the primary key; in postgre, I am not sure how to do this. I have read the documentation, and tried "nextval" as the default - I have searched for the datatype SERIAL, but I am using