Hi all, this is my first post. I have a quick question, and if I have it all wrong I apologise in advance, I'm still trying to get used to a 'real' SQL after moving away from MySQL.

I am using pgAdminIII and have created a table called 'clients' and filled it with data. I then tried to edit the table so there would be a primary key, and auto increment etc. What I've noticed, is if I create a NEW column, and make it of type 'serial' then it automatically creates a sequence, but if I want to go and edit a pre-existing column and change it from type 'integer' to type 'serial' I cannot.

That is fine, I added nextval('clients_id_seq'::regclass) to the Default Value of my ID column, and I even added a sequence called 'clients_id_seq' but the thing is, there is no dependency between the column and the sequence.

How can I go about linking the two?  I'm a bit stuck :)

Any help would be really appreciated.

Rob

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

               http://www.postgresql.org/about/donate

Reply via email to