Re: Postgres Partitions Limitations (

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: navbarry(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Postgres Partitions Limitations (
Date: 2023-01-09 15:40:10
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-hackers

On Fri, 2023-01-06 at 08:28 +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> Page:
> Description:
> Link:
> "Using ONLY to add or drop a constraint on only the partitioned table is
> supported as long as there are no partitions. Once partitions exist, using
> ONLY will result in an error. Instead, constraints on the partitions
> themselves can be added and (if they are not present in the parent table)
> dropped." This seems in contradiction to the example involving adding a
> unique constraint while minimizing locking at the bottom of "
> Partition Maintenance", which seems to run fine on my local Pg instance:
> "
> This technique can be used with UNIQUE and PRIMARY KEY constraints too; the
> indexes are created implicitly when the constraint is created. Example:
> ```ALTER TABLE ONLY measurement ADD UNIQUE (city_id, logdate);
> ALTER TABLE measurement_y2006m02 ADD UNIQUE (city_id, logdate);
> ALTER INDEX measurement_city_id_logdate_key
>     ATTACH PARTITION measurement_y2006m02_city_id_logdate_key;
> ...
> ```
> "
> I might be misinterpreting something. Sorry if that's the case!

No, that is actually an omission in the documentation.

The attached patch tries to improve that.

Laurenz Albe

Attachment Content-Type Size
0001-Fix-omission-in-partitioning-limitation-documentatio.patch text/x-patch 1.5 KB

In response to


Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2023-01-10 15:53:10 The documentation for storage type 'plain' actually allows single byte header
Previous Message David G. Johnston 2023-01-07 17:07:02 Re: 8.5.2 "integral" - "integer"

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2023-01-09 15:40:34 Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert
Previous Message Jim Jones 2023-01-09 15:32:09 Re: [PATCH] psql: Add tab-complete for optional view parameters