Cannot dump foreign key constraints on partitioned table - Mailing list pgsql-hackers

From amul sul
Subject Cannot dump foreign key constraints on partitioned table
Date
Msg-id CAAJ_b94n=UsNVhgs97vCaWEZAMe-tGDRVuZ73oePQH=eaJKGSA@mail.gmail.com
Whole thread Raw
Responses Re: Cannot dump foreign key constraints on partitioned table  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi,

On the master head, getConstraints() function skips FK constraints for
a partitioned table because of tbinfo->hastriggers is false.

While creating FK constraints on the partitioned table, the FK triggers are only
created on leaf partitions and skipped for the partitioned tables.

To fix this, either bypass the aforementioned condition of getConstraints() or
set pg_class.relhastriggers to true for the partitioned table which doesn't seem
to be the right solution, IMO.  Thoughts?

Regards,
Amul


pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: partition pruning doesn't work with IS NULL clause in multikey rangepartition case
Next
From: Bruce Momjian
Date:
Subject: Re: Negotiating the SCRAM channel binding type