Re: constraints names on partitions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: constraints names on partitions
Date
Msg-id CA+Tgmobb9QTk+Q0LrpT_6470FkrdBoYk2haVv6JmZ2w_R7_tUQ@mail.gmail.com
Whole thread Raw
In response to constraints names on partitions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: constraints names on partitions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Oct 12, 2018 at 12:39 PM Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> I just realized that the current code to assign constraint names to
> partitions is going against the SQL standard's idea that constraint
> names must be unique within a schema.  When a partition is created, the
> foreign key gets exactly the same name as the constraint in the parent
> table.

I guess I don't see the point in trying to do something about this in
the partition case but not any other case.  The standard may have a
rule here, but if we don't follow it in general, what benefit do we
get out of trying to sorta follow it in the specific case of
partitions with inherited foreign keys?  There's probably quite a bit
of work to do here to fix this properly - I seem to recall some
previous discussion where it didn't seem simple even to ensure that
constraint names were unique within a relation in certain corner
cases.

At any rate, -1 from me for inserting a fix like this between rc1 and final.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: WIP: "More fair" LWLocks
Next
From: Tom Lane
Date:
Subject: Re: constraints names on partitions