pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Allow UNIQUE indexes on partitioned tables
Date: Mon, 19 Feb 2018 20:40:27 +0000
Message-ID: <E1ensEd-0000vh-Ji@gemulon.postgresql.org> (raw )
Allow UNIQUE indexes on partitioned tables
If we restrict unique constraints on partitioned tables so that they
must always include the partition key, then our standard approach to
unique indexes already works --- each unique key is forced to exist
within a single partition, so enforcing the unique restriction in each
index individually is enough to have it enforced globally. Therefore we
can implement unique indexes on partitions by simply removing a few
restrictions (and adding others.)
Discussion: https://postgr.es/m/20171222212921.hi6hg6pem2w2t36z@alvherre.pgsql
Discussion: https://postgr.es/m/20171229230607.3iib6b62fn3uaf47@alvherre.pgsql
Reviewed-by: Simon Riggs, Jesper Pedersen, Peter Eisentraut, Jaime
Casanova, Amit Langote
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/eb7ed3f3063401496e4aa4bd68fa33f0be31a72f
Modified Files
--------------
doc/src/sgml/ddl.sgml | 9 +-
doc/src/sgml/ref/alter_table.sgml | 15 +-
doc/src/sgml/ref/create_index.sgml | 5 +
doc/src/sgml/ref/create_table.sgml | 18 +-
src/backend/bootstrap/bootparse.y | 2 +
src/backend/catalog/index.c | 50 ++++-
src/backend/catalog/pg_constraint.c | 76 +++++++
src/backend/catalog/toasting.c | 4 +-
src/backend/commands/indexcmds.c | 125 +++++++++--
src/backend/commands/tablecmds.c | 71 ++++++-
src/backend/parser/analyze.c | 7 +
src/backend/parser/parse_utilcmd.c | 31 +--
src/backend/tcop/utility.c | 1 +
src/bin/pg_dump/t/002_pg_dump.pl | 65 ++++++
src/include/catalog/index.h | 5 +-
src/include/catalog/pg_constraint_fn.h | 4 +-
src/include/commands/defrem.h | 1 +
src/include/parser/parse_utilcmd.h | 3 +-
src/test/regress/expected/alter_table.out | 8 -
src/test/regress/expected/create_index.out | 6 +
src/test/regress/expected/create_table.out | 12 --
src/test/regress/expected/indexing.out | 294 +++++++++++++++++++++++++-
src/test/regress/expected/insert_conflict.out | 2 +-
src/test/regress/sql/alter_table.sql | 2 -
src/test/regress/sql/create_index.sql | 6 +
src/test/regress/sql/create_table.sql | 8 -
src/test/regress/sql/indexing.sql | 172 ++++++++++++++-
27 files changed, 907 insertions(+), 95 deletions(-)
view thread (9+ messages) latest in thread
Message-ID: <E1ensEd-0000vh-Ji@gemulon.postgresql.org>
Permalink: ../E1ensEd-0000vh-Ji@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1ensEd-0000vh-Ji@gemulon.postgresql.org
copy link · copy postgr.es
reply 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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org
Subject: Re: pgsql: Allow UNIQUE indexes on partitioned tables
In-Reply-To: <E1ensEd-0000vh-Ji@gemulon.postgresql.org>
References: <E1ensEd-0000vh-Ji@gemulon.postgresql.org>
* 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