pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Олег Самойлов <splarv@ya.ru>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Can not drop partition if exist foreign keys
Date: Fri, 13 Oct 2023 08:05:38 +0200
Message-ID: <77e53f8b7d255e6ca62bf3db3e4dd0336e1a6fee.camel@cybertec.at> (raw)
In-Reply-To: <1113211697122316@mail.yandex.ru>
References: <5E197F1B-BDDF-40AF-9D87-D6792CE1A3B9@ya.ru>
	<4734b034a623e8fa9d7522e4b4b7995cd1f3728f.camel@cybertec.at>
	<1113211697122316@mail.yandex.ru>

On Thu, 2023-10-12 at 17:56 +0300, Олег Самойлов wrote: 
> 11.10.2023, 14:20, "Laurenz Albe" <laurenz.albe@cybertec.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





view thread (5+ messages)

Message-ID: <77e53f8b7d255e6ca62bf3db3e4dd0336e1a6fee.camel@cybertec.at>
Permalink:  ../77e53f8b7d255e6ca62bf3db3e4dd0336e1a6fee.camel@cybertec.at/
Also on:    postgresql.org/message-id/77e53f8b7d255e6ca62bf3db3e4dd0336e1a6fee.camel@cybertec.at

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, splarv@ya.ru
  Subject: Re: Can not drop partition if exist foreign keys
  In-Reply-To: <77e53f8b7d255e6ca62bf3db3e4dd0336e1a6fee.camel@cybertec.at>
  References: <5E197F1B-BDDF-40AF-9D87-D6792CE1A3B9@ya.ru> <4734b034a623e8fa9d7522e4b4b7995cd1f3728f.camel@cybertec.at> <1113211697122316@mail.yandex.ru> <77e53f8b7d255e6ca62bf3db3e4dd0336e1a6fee.camel@cybertec.at>

* 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