Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOTEXISTS ... CHECK ... - Mailing list pgsql-bugs

From Fabrízio de Royes Mello
Subject Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOTEXISTS ... CHECK ...
Date
Msg-id CAFcNs+q3bjJB1W72N7KYJOcEoSUxQ1iCZKtquhH4J7wx2pT9cA@mail.gmail.com
Whole thread Raw
In response to Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... CHECK ...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOTEXISTS ... CHECK ...
List pgsql-bugs

On Tue, Sep 24, 2019 at 5:27 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Alfred R. Fuller" <alfred.fuller@gmail.com> writes:
> > Expected behavior:
> > If the column exists nothing is altered.
> > Actual behavior:
> > The check is always added regardless if the column exists or not.
>
> Yeah, this is yet another variant of the theme that ADD COLUMN IF EXISTS
> only conditionalizes the creation of the column proper, and not other
> subsidiary subcommands such as adding indexes or constraints.  I've been
> poking at a fix [1], and hopefully we'll get it dealt with in v13, but
> for sure it'll be a bigger change than we'd risk back-patching.
>

Nice... I didn't see it... thanks

--
   Fabrízio de Royes Mello         Timbira - http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... CHECK ...
Next
From: Vladimir Ryabtsev
Date:
Subject: