Re: [GENERAL] adding SERIAL to a table

2003-09-04 Thread scott.marlowe
On Mon, 1 Sep 2003, Tom Lane wrote: > "Claudio Lapidus" <[EMAIL PROTECTED]> writes: > > So? Is there a way to add the sequence to an existing table? > > Sure. You have to break the SERIAL down to its component parts though. > Something like > > CREATE SEQUENCE seq; > ALTER TABLE tab

Re: [GENERAL] adding SERIAL to a table

2003-09-02 Thread Tom Lane
"Claudio Lapidus" <[EMAIL PROTECTED]> writes: > So? Is there a way to add the sequence to an existing table? Sure. You have to break the SERIAL down to its component parts though. Something like CREATE SEQUENCE seq; ALTER TABLE tab ADD COLUMN ser INTEGER; UPDATE tab SET s

[GENERAL] adding SERIAL to a table

2003-09-02 Thread Claudio Lapidus
Hello   Now perhaps this is a bit dumb, but...   I just populated a new table via \copy. After that, I realize that perhaps is a good thing to have a row identifier in it, so I try   clapidus=> alter table tickets add column rid serial;NOTICE:  ALTER TABLE will create implicit sequence "tic