Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Andreas Wenk
Scott Marlowe schrieb: On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma wrote: On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk wrote: Why does this not work: postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; ERROR: type "serial" does not exist serial is really just "short-hand" fo

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Andreas Wenk
Richard Broersma schrieb: On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk wrote: Why does this not work: postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; ERROR: type "serial" does not exist serial is really just "short-hand" for making an integer column use default incrementing fun

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Andreas Wenk
Jasen Betts schrieb: On 2009-01-31, Andreas Wenk wrote: Hi List, I have a short question to psql. Why does this not work: postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; ERROR: type "serial" does not exist but this: postgres=# ALTER TABLE tab1 DROP COLUMN nr; ALTER TABLE postgres

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Osvaldo Kussama
2009/2/1 Scott Marlowe : > On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma > wrote: >> On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk >> wrote: >> >>> Why does this not work: >>> >>> postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; >>> ERROR: type "serial" does not exist >> >> serial is

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Grzegorz Jaƛkiewicz
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 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-02-01 Thread Scott Marlowe
On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma wrote: > On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk > wrote: > >> Why does this not work: >> >> postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; >> ERROR: type "serial" does not exist > > serial is really just "short-hand" for making a

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-01-31 Thread Richard Broersma
On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk wrote: > Why does this not work: > > postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; > ERROR: type "serial" does not exist serial is really just "short-hand" for making an integer column use default incrementing function. The following wil

Re: [GENERAL] ALTER TABLE with TYPE serial does not work

2009-01-31 Thread Jasen Betts
On 2009-01-31, Andreas Wenk wrote: > Hi List, > > I have a short question to psql. > > Why does this not work: > > postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; > ERROR: type "serial" does not exist > > but this: > > postgres=# ALTER TABLE tab1 DROP COLUMN nr; > ALTER TABLE > postgres=

[GENERAL] ALTER TABLE with TYPE serial does not work

2009-01-31 Thread Andreas Wenk
Hi List, I have a short question to psql. Why does this not work: postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial; ERROR: type "serial" does not exist but this: postgres=# ALTER TABLE tab1 DROP COLUMN nr; ALTER TABLE postgres=# ALTER TABLE tab1 ADD COLUMN nr serial; NOTICE: ALTER TA