Re: [GENERAL] Adding 'serial' to existing column

2017-11-03 Thread rob stone
On Fri, 2017-11-03 at 16:47 -0400, Tom Lane wrote: > Robert Lakes writes: > > I am new to Postgres and I am trying to build this SQL statement in > > my SQL > > script: > > ALTER TABLE listings_cdc ALTER COLUMN table_id SET DEFAULT > > nextval('tab_id_seq'); > > That looks correct, but this not

Re: [GENERAL] Adding 'serial' to existing column

2017-11-03 Thread Tom Lane
Robert Lakes writes: > I am new to Postgres and I am trying to build this SQL statement in my SQL > script: > ALTER TABLE listings_cdc ALTER COLUMN table_id SET DEFAULT > nextval('tab_id_seq'); That looks correct, but this not so much: > I am trying to build the above-stated command as a dynamic

[GENERAL] Adding 'serial' to existing column

2017-11-03 Thread Robert Lakes
I am new to Postgres and I am trying to build this SQL statement in my SQL script: ALTER TABLE listings_cdc ALTER COLUMN table_id SET DEFAULT nextval('tab_id_seq'); I am trying to build the above-stated command as a dynamic SQL statement: EXECUTE 'ALTER TABLE listings_cdc ALTER COLUMN table_id SE