Re: ALTER TABLE with TYPE serial does not work

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ALTER TABLE with TYPE serial does not work
Date: 2009-02-01 04:04:40
Message-ID: 396486430901312004g50a68c15q33b7678029132861@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk
<a(dot)wenk(at)netzmeister-st-pauli(dot)de> 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 will fully explain what
it is so that you can alter the column:
http://www.postgresql.org/docs/8.3/interactive/datatype-numeric.html#DATATYPE-SERIAL

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Rich 2009-02-01 04:47:28 Re: Pet Peeves
Previous Message Reece Hart 2009-02-01 03:28:29 Re: Pet Peeves?