On Fri, 2023-12-01 at 18:49 +0530, Ashutosh Bapat wrote:
> On Thu, Nov 30, 2023 at 10:29 PM Laurenz Albe <laurenz.a...@cybertec.at> 
> wrote:
> > 
> > On Thu, 2023-11-30 at 19:22 +0530, Ashutosh Bapat wrote:
> > > May be attach the patch to hackers thread (this) as well?
> > 
> > If you want, sure.  I thought it was good enough if the thread
> > is accessible via the commitfest app.
> 
> The addition is long enough that it deserved to be outside of parentheses.
> 
> I think it's worth mentioning the exception but in a way that avoids
> repeating what's mentioned in the last paragraph of just the previous
> section. I don't have brilliant ideas about how to rephrase it.
> 
> Maybe "Using ONLY to add or drop a constraint, other than PRIMARY and
> UNIQUE, on only the partitioned table is supported as long as there
> are no partitions. ...".

I agree that the parenthesis is too long.  I shortened it in the attached
patch. Is that acceptable?

Yours,
Laurenz Albe
From 5a0f480e8ebf26be8dd84ca76dd9217bb7eea860 Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.a...@cybertec.at>
Date: Mon, 4 Dec 2023 21:07:19 +0100
Subject: [PATCH] Doc: Fix omission in partitioning limitations

UNIQUE and PRIMARY KEY constraints can be created on ONLY the
partitioned table.  We already had an example demonstrating that,
but forgot to mention it in the documentation of the limits of
partitioning.

Author: Laurenz Albe
Discussion: https://postgr.es/m/167299368731.659.16130012959616771...@wrigleys.postgresql.org
---
 doc/src/sgml/ddl.sgml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 4490e82aa5..922766ef1c 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -4341,7 +4341,9 @@ ALTER INDEX measurement_city_id_logdate_key
         Using <literal>ONLY</literal> to add or drop a constraint on only
         the partitioned table is supported as long as there are no
         partitions.  Once partitions exist, using <literal>ONLY</literal>
-        will result in an error.  Instead, constraints on the partitions
+        will result in an error (unless you use <literal>ONLY</literal> to
+        create <literal>UNIQUE</literal> and <literal>PRIMARY KEY</literal>
+        constraints as shown above).  Instead, constraints on the partitions
         themselves can be added and (if they are not present in the parent
         table) dropped.
        </para>
-- 
2.43.0

Reply via email to