Re: Two constraints with the same name not always allowed

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: André Hänsel <andre@webkr.de>, pgsql-bugs@postgresql.org
Date: 2018-09-06T21:53:47Z
Lists: pgsql-bugs
On 02/09/2018 19:00, Tom Lane wrote:
> This also points up the lack of a suitable unique index on pg_constraint.
> It's sort of difficult to figure out what that should look like given that
> pg_constraint contains two quasi-independent collections of constraints,
> but maybe UNIQUE(conrelid,contypid,conname) would serve given the
> reasonable assumption that exactly one of conrelid and contypid is zero.

Sketches for assertions set both conrelid and contypid to zero.  I think
the unique constraint would have to include connamespace to support that
properly.

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


Commits

  1. Fully enforce uniqueness of constraint names.