Re: Add a NOT NULL column with default only during add - Mailing list pgsql-general

From BladeOfLight16
Subject Re: Add a NOT NULL column with default only during add
Date
Msg-id CA+=1U=ViG6NnZCSPUXqyJ9uc4rc4ZLLqdkn3Qfdd2eU5ZBmWpA@mail.gmail.com
Whole thread Raw
In response to Re: Add a NOT NULL column with default only during add  (Adrian Klaver <adrian.klaver@gmail.com>)
Responses Re: Add a NOT NULL column with default only during add  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
On Thu, Aug 1, 2013 at 7:53 PM, Adrian Klaver <adrian.klaver@gmail.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?

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Add a NOT NULL column with default only during add
Next
From: Adrian Klaver
Date:
Subject: Re: Add a NOT NULL column with default only during add