Re: Can not drop partition if exist foreign keys

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Олег Самойлов <splarv(at)ya(dot)ru>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Can not drop partition if exist foreign keys
Date: 2023-10-13 06:05:38
Message-ID: 77e53f8b7d255e6ca62bf3db3e4dd0336e1a6fee.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2023-10-12 at 17:56 +0300, Олег Самойлов wrote: 
> 11.10.2023, 14:20, "Laurenz Albe" <laurenz(dot)albe(at)cybertec(dot)at>:
> > On Wed, 2023-10-11 at 14:08 +0300, Олег Самойлов wrote:
> > >  There are two common practice to drop partition from partitioned table: just drop or detach-drop.
> > >  But simple drop don't work if exist foreign key. Example script attached.
> >
> > That is working as designed. You cannot detach a partition of a table if a
> > foreign key points to it.
>
> Nope, of cause any can detach a partition of a empty table even if a foreign key points to it.

You are right, and I was wrong. You can detach partitions from tables with a
foreign key pointing to them.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Luca Ferrari 2023-10-13 11:39:17 psql \du no more showing "member of" column
Previous Message Chris Travers 2023-10-13 05:05:22 Re: Question About PostgreSQL Extensibility