Re: ALTER TABLE with TYPE serial does not work

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ALTER TABLE with TYPE serial does not work
Date: 2009-02-01 11:05:17
Message-ID: 2f4958ff0902010305x120b0ae8p7e687b0d4850eb2c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

all you have to really do is:

create sequence foo_bar_new_column_tralala_seq;
ALTER TABLE foo_bar ADD COLUMN tralala int NOT NULL DEFAULT
nextval('foo_bar_new_column_tralala_seq');

That's all there's to it

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-02-01 11:06:25 Re: Pet Peeves
Previous Message A B 2009-02-01 10:37:52 How to catch the id in a INSERT INTO ... RETURNING function?