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.
The problem is other. Documented that there are two variants how drop partition. Just drop or detach then drop. Both work on a simple partition, but only the second variant works in this case.