Re: ALTER TABLE with TYPE serial does not work

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: ALTER TABLE with TYPE serial does not work
Date: 2009-02-01 02:45:31
Message-ID: gm32cb$vkk$3@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reece Hart 2009-02-01 03:28:29 Re: Pet Peeves?
Previous Message Jasen Betts 2009-02-01 02:38:18 Re: Rollback of Query Cancellation