From: Laurenz Albe <laurenz.albe@cybertec.at>
To: vignesh C <vignesh21@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: jian he <jian.universality@gmail.com>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: create table explicitly mention that unique|primary key constraint will create an
Date: Fri, 26 Jan 2024 16:52:23 +0100
Message-ID: <8334989d2db6ae58b54d4d43a73e7419aa920e0d.camel@cybertec.at> (raw)
In-Reply-To: <CALDaNm0=YqFkMSiZO42dEcD2_qa+5Xvfuu+hbYnVQ5ii+c2kfw@mail.gmail.com>
References: <CACJufxFG682tYcP9aH_F-jrqq5End8MHZR77zcp1=DUrEsSu1Q@mail.gmail.com>
<24f01200b651ff87311ae0f46b99eaf91fc3ec43.camel@cybertec.at>
<f0f2ecbc-3237-4cf7-8fb3-b8eb2b039bf8@eisentraut.org>
<207308248667f3364423e4c61a84e267e7860c9c.camel@cybertec.at>
<CALDaNm0=YqFkMSiZO42dEcD2_qa+5Xvfuu+hbYnVQ5ii+c2kfw@mail.gmail.com>
On Fri, 2024-01-26 at 19:01 +0530, vignesh C wrote:
> CFBot shows that the patch does not apply anymore as in [1]:
There was a conflict with 46a0cd4cefb.
Updated version attached.
Yours,
Laurenz Albe
Attachments:
[text/x-patch] v4-0001-Doc-All-relations-share-a-namespace.patch (3.4K, ../8334989d2db6ae58b54d4d43a73e7419aa920e0d.camel@cybertec.at/2-v4-0001-Doc-All-relations-share-a-namespace.patch)
download | inline diff:
From 193d6d6c20f0c2976e0b63f1896978545def3fe8 Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Fri, 26 Jan 2024 16:50:11 +0100
Subject: [PATCH v4] Doc: All relations share a namespace
This was already documented in the CREATE INDEX reference,
but not in the introductory "Data Definition" chapter.
Also, document that the index that implements a constraint
has the same name as the constraint.
Author: Laurenz Albe
Reviewed-by: Jian He, Peter Eisentraut, David G. Johnston
Discussion: https://postgr.es/m/CACJufxFG682tYcP9aH_F-jrqq5End8MHZR77zcp1%3DDUrEsSu1Q%40mail.gmail.com
---
doc/src/sgml/ddl.sgml | 6 +++++-
doc/src/sgml/ref/create_table.sgml | 8 +++++---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgmlindex fc03a349f0..434e074df1 100644--- a/doc/src/sgml/ddl.sgml+++ b/doc/src/sgml/ddl.sgml@@ -3003,7 +3003,11 @@ SELECT * FROM information WHERE group_id = 2 FOR UPDATE;
<para>
A database contains one or more named <firstterm>schemas</firstterm>, which
in turn contain tables. Schemas also contain other kinds of named
- objects, including data types, functions, and operators. The same+ objects, including data types, functions, and operators. Within one schema,+ two objects of the same type cannot have the same name. All relations+ (tables, sequences, indexes, views, materialized views, and foreign tables)+ share one name space, so they need to have different names if they are in+ a single schema. The same
object name can be used in different schemas without conflict; for
example, both <literal>schema1</literal> and <literal>myschema</literal> can
contain tables named <literal>mytable</literal>. Unlike databases,
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgmlindex 079af9126a..bdc3541930 100644--- a/doc/src/sgml/ref/create_table.sgml+++ b/doc/src/sgml/ref/create_table.sgml@@ -1027,7 +1027,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
Adding a unique constraint will automatically create a unique B-tree
index on the column or group of columns used in the constraint. But if
the constraint includes a <literal>WITHOUT OVERLAPS</literal> clause, it
- will use a GiST index.+ will use a GiST index. The created index has the same name as the unique+ constraint.
</para>
<para>
@@ -1082,6 +1083,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
<literal>PRIMARY KEY</literal> constraint will automatically create a
unique B-tree index, or GiST if <literal>WITHOUT OVERLAPS</literal> was
specified, on the column or group of columns used in the constraint.
+ That index has the same name as the primary key constraint.
</para>
<para>
@@ -1118,8 +1120,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
<para>
Exclusion constraints are implemented using
- an index, so each specified operator must be associated with an- appropriate operator class+ an index that has the same name as the constraint, so each specified+ operator must be associated with an appropriate operator class
(see <xref linkend="indexes-opclass"/>) for the index access
method <replaceable>index_method</replaceable>.
The operators are required to be commutative.
--
2.43.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: laurenz.albe@cybertec.at, vignesh21@gmail.com, peter@eisentraut.org, jian.universality@gmail.com, pgsql-docs@lists.postgresql.org
Subject: Re: create table explicitly mention that unique|primary key constraint will create an
In-Reply-To: <8334989d2db6ae58b54d4d43a73e7419aa920e0d.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox