From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: partitioned tables referenced by FKs
Date: Wed, 27 Mar 2019 10:22:21 -0400
Message-ID: <d70b6616-a4fd-3fc8-ae27-5907496fc535@redhat.com> (raw)
In-Reply-To: <20190326213924.GA2322@alvherre.pgsql>
References: <20190326213924.GA2322@alvherre.pgsql>
Hi,
On 3/26/19 5:39 PM, Alvaro Herrera wrote:
>>> As I said before, I'm thinking of getting rid of the whole business of
>>> checking partitions on the referenced side of an FK at DROP time, and
>>> instead jut forbid the DROP completely if any FKs reference an ancestor
>>> of that partition.
>>
>> Will that allow `DROP TABLE parted_pk CASCADE` to succeed even if
>> partitions still contain referenced data? I suppose that's the example
>> you cited upthread as a bug that remains to be solved.
>
> That's the idea, yes, it should do that: only allow a DROP of a
> partition referenced by an FK if the topmost constraint is also being
> dropped. Maybe this means I need to get rid of 0002 completely. But I
> haven't got to doing that yet.
>
I think that is ok, if doc/src/sgml/ref/drop_table.sgml is updated with
a description of how CASCADE works in this scenario.
Best regards,
Jesper
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: jesper.pedersen@redhat.com, alvherre@2ndquadrant.com, Langote_Amit_f8@lab.ntt.co.jp
Subject: Re: partitioned tables referenced by FKs
In-Reply-To: <d70b6616-a4fd-3fc8-ae27-5907496fc535@redhat.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