Re: incorrect (incomplete) description for "alter domain"

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "elionescu(at)yahoo(dot)com" <elionescu(at)yahoo(dot)com>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: incorrect (incomplete) description for "alter domain"
Date: 2024-10-16 21:11:54
Message-ID: ZxAsGmcyYk8es5ac@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Mon, Jul 29, 2024 at 11:17:41AM -0400, Tom Lane wrote:
> I wrote:
> > I think the page is technically correct, but I'm inclined to duplicate
> > this text from the CREATE DOMAIN page:
>
> > where domain_constraint is:
> > [ CONSTRAINT constraint_name ]
> > { NOT NULL | NULL | CHECK (expression) }
>
> > rather than making readers go look that up.
>
> Actually, there *is* a bug in the description, because experimentation
> shows that CREATE DOMAIN accepts NULL in this syntax (as advertised)
> but ALTER DOMAIN does not. We could alternatively decide that that's
> a code bug and make ALTER DOMAIN take it, but I don't think it's worth
> any effort (and this behavior may actually have been intentional, too).
> I think we should just add
>
> where domain_constraint is:
>
> [ CONSTRAINT constraint_name ]
> { NOT NULL | CHECK (expression) }
>
> to the ALTER DOMAIN page, and then remove the claim that it's
> identical to CREATE DOMAIN.

I have written the attached patch to document this. I assume this
should be backpatched to PG 12.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

When a patient asks the doctor, "Am I going to die?", he means
"Am I going to die soon?"

Attachment Content-Type Size
domain.diff text/x-diff 1.4 KB

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2024-10-16 22:11:50 Re: Undocumented optionality of handler_statements
Previous Message Bruce Momjian 2024-10-16 20:54:43 Re: Documentation of .pgpass for Unix is incomplete