Re: alter table serial->int

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Erik Aronesty <erik(at)q32(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: alter table serial->int
Date: 2007-11-08 19:57:21
Message-ID: 20071108195721.GU2938@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Erik Aronesty wrote:
> -- Simpler example for you
>
> CREATE TABLE x (
> id serial NOT NULL
> );
>
> ALTER TABLE x alter id type int;
>
> -- Under 8.1.10, a call to pg_dump will reveal the change has not happened

Do an ALTER TABLE DROP DEFAULT instead. SERIAL is a macro for "int with
a default".

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Igor Neyman 2007-11-08 20:04:59 Re: alter table serial->int
Previous Message Erik Aronesty 2007-11-08 16:17:44 Re: alter table serial->int