On Wed, Sep 02, 2009 at 04:40:13PM +0400, Igor Katson wrote:
> I have a table, which has a creation_ts (timestamp) column, but does
> not have a id (serial) column. I want to add such a one, but, AFAIK,
> if I enter
>
> ALTER TABLE table ADD COLUMN id serial
>
> it will randomly put the sequence
I have a table, which has a creation_ts (timestamp) column, but does not
have a id (serial) column. I want to add such a one, but, AFAIK, if I enter
ALTER TABLE table ADD COLUMN id serial
it will randomly put the sequence numbers.
I wrote a function, which uses a cursor and UPDATE WHERE CURRENT