Missing "CONSTRAINT" keyword in ADD CONSTRAINT form?

Started by PG Bug reporting formover 2 years ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/sql-alterdomain.html
Description:

(apologies, I managed to send this too soon, just now, somehow)

The example for ALTER DOMAIN shows:

ALTER DOMAIN zipcode ADD CONSTRAINT zipchk CHECK (char_length(VALUE) = 5);

...yet the syntax suggests no CONSTRAINT-keyword (I'm guessing?) should be
used:

ALTER DOMAIN name ADD domain_constraint [ NOT VALID ]

When it should, I think?

#2Tim Needham
tim.needham2@gmail.com
In reply to: PG Bug reporting form (#1)
Re: Missing "CONSTRAINT" keyword in ADD CONSTRAINT form?

Bah, scratch that, sorry again. It's because "CONSTRAINT" is implied by the
reference to CREATE DOMAIN, isn't it?
Sorry.

On Mon, Dec 4, 2023 at 8:29 PM PG Doc comments form <noreply@postgresql.org>
wrote:

Show quoted text

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/sql-alterdomain.html
Description:

(apologies, I managed to send this too soon, just now, somehow)

The example for ALTER DOMAIN shows:

ALTER DOMAIN zipcode ADD CONSTRAINT zipchk CHECK (char_length(VALUE) = 5);

...yet the syntax suggests no CONSTRAINT-keyword (I'm guessing?) should be
used:

ALTER DOMAIN name ADD domain_constraint [ NOT VALID ]

When it should, I think?

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: Tim Needham (#2)
Re: Missing "CONSTRAINT" keyword in ADD CONSTRAINT form?

On Monday, December 4, 2023, Tim Needham <tim.needham2@gmail.com> wrote:

Bah, scratch that, sorry again. It's because "CONSTRAINT" is implied by
the reference to CREATE DOMAIN, isn't it?

Yes, we require the reader to go to the create domain page to read the
“domain_constraint” portion of the syntax.

David J.