Re: TRUNCATE tables referenced by FKs on partitioned tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: TRUNCATE tables referenced by FKs on partitioned tables
Date
Msg-id 20180711225916.domrlbkmukhrg6jg@alvherre.pgsql
Whole thread Raw
In response to Re: TRUNCATE tables referenced by FKs on partitioned tables  (Michael Paquier <michael@paquier.xyz>)
Responses Re: TRUNCATE tables referenced by FKs on partitioned tables  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 2018-Jul-11, Michael Paquier wrote:

> > alvherre=# truncate table prim, partfk;
> > ERROR:  cannot truncate a table referenced in a foreign key constraint
> > DETALLE:  Table "partfk" references "prim".
> > SUGERENCIA:  Truncate table "partfk" at the same time, or use TRUNCATE ... CASCADE.
> 
> Your first and second queries are the same :)

Yeah, C&P failure :-(

Anyway, this patch seems to fix it, and adds what I think is appropriate
test coverage.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Mai Peng
Date:
Subject: Segfault logical replication PG 10.4
Next
From: Mai Peng
Date:
Subject: Re: ERROR: cannot start subtransactions during a parallel operation