Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... CHECK ...

From: "Alfred R(dot) Fuller" <alfred(dot)fuller(at)gmail(dot)com>
To: fabriziomello(at)gmail(dot)com
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... CHECK ...
Date: 2019-09-24 21:50:54
Message-ID: CAMESm9LBKMJJCd134aOgnemN1XiD1Cd7rTfSoJM1EQ+YMQc+vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks for the quick response! Do you have any suggestion on work arounds?

On Tue, Sep 24, 2019 at 1:31 PM Fabrízio de Royes Mello <
fabriziomello(at)gmail(dot)com> wrote:

>
> On Tue, Sep 24, 2019 at 5:27 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > "Alfred R. Fuller" <alfred(dot)fuller(at)gmail(dot)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
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Vladimir Ryabtsev 2019-09-25 00:27:40 Re:
Previous Message Peter Geoghegan 2019-09-24 21:04:27 Re: