Re: Bug in 7.2.1? -- ERROR: Adding columns with defaults is not implemented.

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: ad wolf <adwolf1(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bug in 7.2.1? -- ERROR: Adding columns with defaults is not implemented.
Date: 2002-07-08 23:37:35
Message-ID: 20020709093735.A29704@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jul 06, 2002 at 05:33:29PM -0700, ad wolf wrote:
> Using pg 7.1.2, I can enter the following statement successfully:
>
> # alter table manufacturer add column dummy integer not null default
> 1;
>
> However, under 7.2.1, the same statement gets me --
>
> ERROR: Adding columns with defaults is not implemented.
> Add the column, then use ALTER TABLE SET DEFAULT.
>
> My question is two-fold -- first, is this new behavior a feature, or a
> bug?

The new behaviour is a feature. It's telling you that the default clause
doesn't work. 7.1.2 accepted the statement but ignored the default. So you
needed the second statement anyway. 7.2 just made it explicit.

>
> Second, what features/fixes would i lose by reverting to 7.1.2?
>
> I'd like to stick with 7.2.1, but this new behavior is making it
> difficult for me. I can't simply drop & recreate all my tables just
> to add a column!

Read the message. It says to add the column (without the default) and then
use "alter table set default".

HTH,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Carmen Wai 2002-07-09 00:01:01 SPI_exec
Previous Message Robert Treat 2002-07-08 23:25:50 Re: Error messages changes for 7.3?