Postgres Partitions Limitations (

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: navbarry(at)gmail(dot)com
Subject: Postgres Partitions Limitations (
Date: 2023-01-06 08:28:07
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-hackers

The following documentation comment has been logged on the website:



"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!



Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2023-01-07 11:24:23 8.5.2 "integral" - "integer"
Previous Message Tom Lane 2023-01-05 19:15:35 Re: There is no command pg_ctl reload in Postgresql 13 clusters

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema 2023-01-06 08:37:05 Re: Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist
Previous Message Amit Langote 2023-01-06 08:26:58 Re: ATTACH PARTITION seems to ignore column generation status