From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: alter table docs
Date: Mon, 30 Jul 2018 14:07:55 -0700
Message-ID: <f5e925de-5ef6-59a5-e26f-1668ff25562b@aklaver.com> (raw)
In-Reply-To: <a2f2d56b-7c65-e5ba-334e-152c55228881@gmail.com>
References: <a2f2d56b-7c65-e5ba-334e-152c55228881@gmail.com>
On 07/30/2018 09:57 AM, Rob Sargent wrote:
> I was just looking up alter table add constraint syntax under
> "current(10)" and we get
>
> ADD /table_constraint/ [ NOT VALID ]
> ADD /table_constraint_using_index/
>
> There is a description below for the using_index version but none for
> the plain version. There is a block for the plain version on the CREATE
I see one:
https://www.postgresql.org/docs/10/static/sql-altertable.html
"ADD table_constraint [ NOT VALID ]
This form adds a new constraint to a table using the same syntax as
CREATE TABLE, plus the option NOT VALID, which is currently only allowed
for foreign key and CHECK constraints. If the constraint is marked NOT
VALID, the potentially-lengthy initial check to verify that all rows in
the table satisfy the constraint is skipped. The constraint will still
be enforced against subsequent inserts or updates (that is, they'll fail
unless there is a matching row in the referenced table, in the case of
foreign keys; and they'll fail unless the new row matches the specified
check constraints). But the database will not assume that the constraint
holds for all rows in the table, until it is validated by using the
VALIDATE CONSTRAINT option.
"
> TABLE page. Should it not also appear in the ALTER TABLE page?
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, robjsargent@gmail.com
Subject: Re: alter table docs
In-Reply-To: <f5e925de-5ef6-59a5-e26f-1668ff25562b@aklaver.com>
References: <a2f2d56b-7c65-e5ba-334e-152c55228881@gmail.com> <f5e925de-5ef6-59a5-e26f-1668ff25562b@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox