Re: Can not drop partition if exist foreign keys

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

Re: Can not drop partition if exist foreign keys

2023-10-12 Thread Олег Самойлов
  11.10.2023, 14:20, "Laurenz Albe" :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 ca

Re: Can not drop partition if exist foreign keys

2023-10-11 Thread Laurenz Albe
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

Re: Can not drop partition if exist foreign keys

2023-10-11 Thread Alvaro Herrera
On 2023-Oct-11, Олег Самойлов 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. Yeah. Detach it first, then you should be able to drop it. > psql:test.sql:15: E

Can not drop partition if exist foreign keys

2023-10-11 Thread Олег Самойлов
Hi all. 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. test.sql Description: Binary data $ psql -p 5416 -a -f test.sql \setenv PSQL_EDITOR 'vim' \setenv PSQL_EDITOR_LIN