Re: Add a NOT NULL column with default only during add

From: BladeOfLight16 <bladeoflight16(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Add a NOT NULL column with default only during add
Date: 2013-08-01 23:59:09
Message-ID: CA+=1U=ViG6NnZCSPUXqyJ9uc4rc4ZLLqdkn3Qfdd2eU5ZBmWpA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 1, 2013 at 7:53 PM, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>wrote:

> It fails because
>
> ALTER TABLE x
> ADD COLUMN data2 VARCHAR(10) NOT NULL DEFAULT 'foo',
>
> end in , instead of ;
>
> You have to add the column before you can alter it.
>

=/ That's the way I have it in the SQL Fiddle sample I provided. I was
asking what Mr. Broersma was suggesting.

I appreciate the effort by both of you, but it seems my points aren't
getting across. Is there something more I can do to clarify?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-08-02 00:15:51 Re: Add a NOT NULL column with default only during add
Previous Message Adrian Klaver 2013-08-01 23:53:06 Re: Add a NOT NULL column with default only during add