Re: ALTER TABLE with TYPE serial does not work

From: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
To: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ALTER TABLE with TYPE serial does not work
Date: 2009-02-01 20:08:36
Message-ID: 49860144.1000405@netzmeister-st-pauli.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jasen Betts schrieb:
> On 2009-01-31, Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de> 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=# ALTER TABLE tab1 ADD COLUMN nr serial;
>> NOTICE: ALTER TABLE will create implicit sequence "tab1_nr_seq" for
>> serial column "tab1.nr"
>> ALTER TABLE
>
> because serial isn't a type.
>
ah - I think this is what the error message says ;-/ ... ?? !!

--

St.Pauli - Hamburg - Germany

Andreas Wenk

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Rich 2009-02-01 20:15:16 Re: Pet Peeves
Previous Message Adrian Klaver 2009-02-01 20:02:49 Re: Pet Peeves