Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jCbmx-0005tv-Iq for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2020 04:19:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jCbmu-0006kQ-Pm for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2020 04:19:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jCbmu-0006kJ-DZ for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2020 04:19:08 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jCbmn-000576-DF for pgsql-hackers@postgresql.org; Fri, 13 Mar 2020 04:19:07 +0000 Received: from [10.0.7.107] ([80.242.212.26]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MnJdE-1jeHYG3bTY-00jFRL; Fri, 13 Mar 2020 05:18:45 +0100 Subject: Re: Add A Glossary To: Corey Huinker Cc: Roger Harkavy , pgsql-hackers@postgresql.org, Fabien COELHO , Michael Paquier References: <20191125075507.GH99720@paquier.xyz> <763ae38f-599b-cfb9-0447-337649dfb017@purtz.de> From: =?UTF-8?Q?J=c3=bcrgen_Purtz?= Message-ID: <0ba54895-2455-60d7-3244-36030ff2f1e4@purtz.de> Date: Fri, 13 Mar 2020 10:18:40 +0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------3AF9E3934764B22EF04BE12F" Content-Language: en-US X-Provags-ID: V03:K1:1I4rlKc6o/0azzwd4oM1lOpqPzQqIzSYovmTRAubtfMD3gpmhgD yYqY4qpc7fNaEGWiUN9qlcLJfRCmofPLp3KccXkyWZiOEO2UDxhQLM6iq9guoNIaYok/9YJ u1yQxXG0ppHo59kc50YcFsh8usoqREpFVDYCCL7cLrVH6a5hlACXPEO+ViBfzzSntwtSvBw 5X50TbrudvU6r4Wjjc3EQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+egR07rPeSg=:C1vNGKJZnJ9/+3N4l0Itkr S+KpNWdzRYne69BH2w7lIXeemgj+EhyUTGwvUXu8K2GEt8J36kNCznWQ7R9oDJohTWvxXwzKI ZDNjl3pSvSv4gm6AoR8lnKCCkzLw1phjEmSJz9JY61cYa0TZ87Dd440iE8DMZWL7E3MghiNX+ gAeWyO6xAQUsEh+U6Wi0rMIuqoRlKy30EypyCjMCYS2JHRXl48cujFN0LiGTlCJ2yyF9tb+15 U9VnMZA0PedaSnw6o/7AERcWFhQLwS5ucexLmMYDcs6ABUDnwGDIdsKiwVFoJ9Gogl0FVJPAe EK0/vDO6uLg6O961flInijoAgmgXZqnRHsHAxcZ0Ve8+qIrn/TaDNUh2xJIKCd7BZepc5qy4l W8bvk9+K4A5fnR3yOshc5iHagpWVhnWX8041fE4OndPi96KnYIU0P39iO2dUAYFQssNi6DNYY B2UY/v8iajJXQXslwJ53PoAcU3sxr605LLnaaA8cpcKAEI3rNfhfbKFFxvG89rDKh4UPlFCUe fbYU08ZGEctwvdiuDJ9U0tdzDLXQ8KmOjUhmlDD49LeJZwt+sfhicCZa+MKXx9lO9hKjPEcp5 9iFE2TXvE+/9mFOjEyvJg7PL9CT1E/uR87P+fXGlyAeFBdks/4RV6Vt/iF/9NfInjNpY0RWXD 4G4JOAq2kqqCIjgSVcqGibsR9PC48S7U7R/o8gHRiQiLMet1EX4f8Vaphe7DX4ZmK3N85vH+6 u928nu/WaPxy47L8clC36Jh2gZObyY5kwCjlIhsnc1WP41lTgE4j/plNsYDQE1biSbOj6NuZm rBB61ux6J4BXFyLa5+L8+05qMKaUPe46uZxL03H3Fqiq3MVCzeqoWNafpEJfgeKlqUUmu6q List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------3AF9E3934764B22EF04BE12F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit > The statement that names of schema objects are unique isn't > /strictly/ true, just /mostly/ true. Take the case of a unique > constraints. Concerning CONSTRAINTS you are right. Constraints seems to be an exception: * Their name belongs to a schema, but are not necessarily unique within this context: https://www.postgresql.org/docs/current/catalog-pg-constraint.html. * There is a UNIQUE index within the system catalog pg_constraints: "pg_constraint_conrelid_contypid_conname_index" UNIQUE, btree (conrelid, contypid, conname), which expresses that names are unique within the context of a table/constraint-type. Nevertheless tests have shown that some stronger restrictions exists across table-boarders (,which seems to be implemented in CREATE statements - or as a consequence of your mentioned correlation between constraint and index ?). I hope that there are no more such exception to the global rule 'object names in a schema are unique': https://www.postgresql.org/docs/current/sql-createschema.html This facts must be mentioned as a short note in glossary and in more detail in the later patch about the architecture. J. Purtz --------------3AF9E3934764B22EF04BE12F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
The statement that names of schema objects are unique isn't strictly true, just mostly true. Take the case of a unique constraints.

Concerning CONSTRAINTS you are right. Constraints seems to be an exception:

  • Their name belongs to a schema, but are not necessarily unique within this context: https://www.postgresql.org/docs/current/catalog-pg-constraint.html.
  • There is a UNIQUE index within the system catalog pg_constraints:  "pg_constraint_conrelid_contypid_conname_index" UNIQUE, btree (conrelid, contypid, conname), which expresses that names are unique within the context of a table/constraint-type. Nevertheless tests have shown that some stronger restrictions exists across table-boarders (,which seems to be implemented in CREATE statements - or as a consequence of your mentioned correlation between constraint and index ?).

I hope that there are no more such exception to the global rule 'object names in a schema are unique': https://www.postgresql.org/docs/current/sql-createschema.html

This facts must be mentioned as a short note in glossary and in more detail in the later patch about the architecture.

J. Purtz


--------------3AF9E3934764B22EF04BE12F--