Re: adding columns with defaults is not implemented

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Marcelo <marcelo(at)humano2(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: adding columns with defaults is not implemented
Date: 2005-06-02 20:43:20
Message-ID: 1117745000.5758.31.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2005-06-02 at 15:29, Marcelo wrote:
> Hello,
> Using Postgres 7.4, I am trying to perform an "alter table
> temptable add column "myCol" serial"
>
> It gives the following msg
> ERROR: adding columns with defaults is not implemented
>
> You cannot add a column that is serial in a table which already has
> data in postgres 7.
>
> Is there a way I can create a serial column on a table which already
> has data? Or is the only solution upgrading to postgres 8 ?

You can add a default after you add the column with a separate alter
table statement...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Douglas McNaught 2005-06-02 20:57:14 Re: adding columns with defaults is not implemented
Previous Message Marcelo 2005-06-02 20:29:04 adding columns with defaults is not implemented