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

From Vik Fearing
Subject Re: Add a NOT NULL column with default only during add
Date
Msg-id 51FB72FA.9010107@dalibo.com
Whole thread Raw
In response to Re: Add a NOT NULL column with default only during add  (BladeOfLight16 <bladeoflight16@gmail.com>)
List pgsql-general
On 08/02/2013 10:03 AM, BladeOfLight16 wrote:
> So my question is effectively this: Is there an existing, equivalent,
> single DDL statement to the following hypothetical SQL?
>
> ALTER TABLE x
> ADD COLUMN data2 VARCHAR(10) NOT NULL USING 'foo';
>
> where "USING" here would indicate the same thing it does in an ALTER
> COLUMN data2 TYPE [data type] USING 'foo' command.
>
> I suspect the answer is "No, this feature does not exist right now,"
> and that's fine if so. I am just asking if my guess is correct or if
> I've missed the feature somewhere.

Your guess is unfortunately correct.

Vik


pgsql-general by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: Recovery_target_time misinterpreted?
Next
From: Klaus Ita
Date:
Subject: Re: Recovery_target_time misinterpreted?