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 1tBEra-002elB-Gb for pgsql-docs@arkaria.postgresql.org; Wed, 13 Nov 2024 15:00:57 +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 1tBErW-00Euz6-UV for pgsql-docs@arkaria.postgresql.org; Wed, 13 Nov 2024 15:00:55 +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 1tBErW-00Euyr-Mi for pgsql-docs@lists.postgresql.org; Wed, 13 Nov 2024 15:00:55 +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 1tBErU-001gL9-CR for pgsql-docs@lists.postgresql.org; Wed, 13 Nov 2024 15:00:53 +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 4ADF0oX91363396; Wed, 13 Nov 2024 10:00:50 -0500 From: Tom Lane To: "David G. Johnston" cc: =?UTF-8?B?ItCh0LXRgNCz0LXQuSDQnyAoU2VyZ2VpRG9zKSI=?= , "pgsql-docs@lists.postgresql.org" Subject: Re: Generated names (suffix) for constraints not described in docs In-reply-to: References: <712E40A2-744F-424E-AE45-95CE5BE27D82@gmail.com> Comments: In-reply-to "David G. Johnston" message dated "Wed, 13 Nov 2024 07:22:46 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1363391.1731510050.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 13 Nov 2024 10:00:50 -0500 Message-ID: <1363392.1731510050@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Wednesday, November 13, 2024, "Сергей П (SergeiDos)" < > podrezov.sergey@gmail.com> wrote: >> In the documentation for the Constraints section >> https://www.postgresql.org/docs/current/ddl-constraints.html there is a >> phrase: "So, to specify a named constraint, use the key word CONSTRAINT >> followed by an identifier followed by the constraint definition. (If you >> can't specify a constraint name in this way, the system choose a name for >> you.)" >> But nowhere in the documentation are the rules by which it generates names >> on its own described. > Correct. Which means the specific name chosen is an implementation detail > that can change at any time and should not be relied upon by the > DBA. Indeed. I double-checked the SQL spec and found that it says 3) If is not specified, then a that contains an implementation- dependent is implicit. The assigned shall obey the Syntax Rules of an explicit . "Implementation-dependent" is standards-ese for "implementations don't have to document their exact behavior". (If it said "implementation-defined", that would mean we should.) So not documenting it is expected. I think we have indeed changed the details around this in the past. regards, tom lane