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

From: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
To: BladeOfLight16 <bladeoflight16(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, 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-02 08:51:06
Message-ID: 51FB72FA.9010107@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Klaus Ita 2013-08-02 09:29:45 Re: Recovery_target_time misinterpreted?
Previous Message Albe Laurenz 2013-08-02 08:22:47 Re: Recovery_target_time misinterpreted?