Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYS8B-00BU73-Pa for pgsql-docs@arkaria.postgresql.org; Mon, 29 Jul 2024 15:17:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sYS8A-000dTN-0h for pgsql-docs@arkaria.postgresql.org; Mon, 29 Jul 2024 15:17:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYS89-000dTF-Oz for pgsql-docs@lists.postgresql.org; Mon, 29 Jul 2024 15:17:45 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYS87-00239s-9b for pgsql-docs@lists.postgresql.org; Mon, 29 Jul 2024 15:17:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 46TFHfmN2596730; Mon, 29 Jul 2024 11:17:41 -0400 From: Tom Lane To: "David G. Johnston" cc: "elionescu@yahoo.com" , "pgsql-docs@lists.postgresql.org" Subject: Re: incorrect (incomplete) description for "alter domain" In-reply-to: <2585954.1722265086@sss.pgh.pa.us> References: <172225092461.915373.6103973717483380183@wrigleys.postgresql.org> <2585954.1722265086@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 29 Jul 2024 10:58:06 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2596728.1722266261.1@sss.pgh.pa.us> Date: Mon, 29 Jul 2024 11:17:41 -0400 Message-ID: <2596729.1722266261@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. regards, tom lane