pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: unique indexes on partitioned tables
Date: Fri, 26 Jan 2018 13:42:17 -0500
Message-ID: <f974273b-50e6-b916-fb59-cbb1d057793f@2ndquadrant.com> (raw)
In-Reply-To: <20180122225559.7pbzomvgp5iwmath@alvherre.pgsql>
References: <20180122225559.7pbzomvgp5iwmath@alvherre.pgsql>

On 1/22/18 17:55, Alvaro Herrera wrote:
> Alvaro Herrera wrote:
>> Version 4 of this patch, rebased on today's master.

+           if (key->partattrs[i] == 0)
+               ereport(ERROR,
+                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                        errmsg("unsupported %s constraint with
partition key definition",
+                               constraint_type),
+                        errmsg("%s constraints cannot be used when
partition keys include expressions.",
+                               constraint_type)));

Double errmsg().  (Maybe an Assert somewhere should help catch this?)

+alter table idxpart add primary key (a);       -- not an incomplete one tho

"though"?

I would like to see some tests that the unique constraints are actually
enforced.  That is, insert some duplicate values and see it fail.  Throw
some null values in, to check PK behavior as well.  It should be
trivial, but seems kind of useful.

Other than that, this looks pretty good to me.  A logical extension of
the previous partitioned index patch.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (21+ messages)  latest in thread

Message-ID: <f974273b-50e6-b916-fb59-cbb1d057793f@2ndquadrant.com>
Permalink:  ../f974273b-50e6-b916-fb59-cbb1d057793f@2ndquadrant.com/
Also on:    postgresql.org/message-id/f974273b-50e6-b916-fb59-cbb1d057793f@2ndquadrant.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, alvherre@alvh.no-ip.org
  Subject: Re: unique indexes on partitioned tables
  In-Reply-To: <f974273b-50e6-b916-fb59-cbb1d057793f@2ndquadrant.com>

* 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