ALTER TABLE with TYPE serial does not work

From: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: ALTER TABLE with TYPE serial does not work
Date: 2009-01-31 23:16:58
Message-ID: 4984DBEA.7090301@netzmeister-st-pauli.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 TABLE will create implicit sequence "tab1_nr_seq" for
serial column "tab1.nr"
ALTER TABLE

Sitting in front of a MAC OS X Leo with pg 8.2

Thanks a lot!

Cheers

Andy
--
St.Pauli - Hamburg - Germany

Andreas Wenk

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2009-01-31 23:36:13 Re: Pet Peeves?
Previous Message Octavio Alvarez 2009-01-31 22:35:16 Re: Pet Peeves?