Re: Alter table column constraint

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Rich Shepard <rshepard(at)appl-ecosys(dot)com>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Alter table column constraint
Date: 2018-12-17 20:13:57
Message-ID: CANu8FizqULQssy4a0ewNWUEwxc6UhtQdDKX5sYFjNhCVwtfdyg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>I want to alter a term in a column's constraint to allow only specified
> strings as attributes
Yes, you must drop then add the revised constraint. However, from your
statement above, it sounds to
me as if you would be better off using A FOREIGN kEY CONSTRAINT. It makes
things a lot simpler.

On Mon, Dec 17, 2018 at 3:07 PM Joshua D. Drake <jd(at)commandprompt(dot)com>
wrote:

> On 12/17/18 12:01 PM, Rich Shepard wrote:
> > On Mon, 17 Dec 2018, Rich Shepard wrote:
> >
> >> I want to alter a term in a column's constraint to allow only specified
> >> strings as attributes and have not found how to do this in the docs
> >> (using
> >> version 10 docs now). There is an alter table command that allows
> >> renaming
> >> a constraint but I've not seen how to modify the constraint itself.
> >
> > Is the procedure to drop the current check constraint then add the
> > revised
> > one?
>
> Or the other way around but yes.
>
> JD
>
>
> >
> > Rich
> >
>
> --
> Command Prompt, Inc. || http://the.postgres.company/ || @cmdpromptinc
> *** A fault and talent of mine is to tell it exactly how it is. ***
> PostgreSQL centered full stack support, consulting and development.
> Advocate: @amplifypostgres || Learn: https://postgresconf.org
> ***** Unless otherwise stated, opinions are my own. *****
>
>
>

--
*Melvin Davidson*
*Maj. Database & Exploration Specialist*
*Universe Exploration Command – UXC*
Employment by invitation only!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2018-12-17 20:20:09 Re: Alter table column constraint
Previous Message Joshua D. Drake 2018-12-17 20:06:50 Re: Alter table column constraint