Re: constraints names on partitions

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: constraints names on partitions
Date: 2018-10-15 16:19:42
Message-ID: CA+Tgmobb9QTk+Q0LrpT_6470FkrdBoYk2haVv6JmZ2w_R7_tUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 12, 2018 at 12:39 PM Alvaro Herrera
<alvherre(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-10-15 16:32:21 Re: constraints names on partitions
Previous Message Alexander Korotkov 2018-10-15 16:06:35 Re: WIP: "More fair" LWLocks