Re: TRUNCATE tables referenced by FKs on partitioned tables

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-07-12T16:29:48Z
Lists: pgsql-hackers
On 2018-Jul-12, Michael Paquier wrote:

> On Wed, Jul 11, 2018 at 06:59:16PM -0400, Alvaro Herrera wrote:
> > Anyway, this patch seems to fix it, and adds what I think is appropriate
> > test coverage.
> 
> This looks good to me.  I am noticing that the documentation of TRUNCATE
> does not mention that when running the command on a partitioned table
> then it automatically gets to the children even if CASCADE is not used
> and each child partition is not listed.

Hmm ... well, that's not new -- I think that came in with pg10.

> What is the filler column added in truncpart used for?

Nothing.  Also column b -- I had an additional different test, but then
I discovered it wasn't testing anything new.  Removed both.

Pushed, thanks for looking!

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


Commits

  1. Fix FK checks of TRUNCATE involving partitioned tables