Re: [HACKERS] [BUGS] BUG #14759: insert into foreign data partitionsfail - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] [BUGS] BUG #14759: insert into foreign data partitionsfail
Date
Msg-id f5957799-371a-c398-b1d7-016c25e1e804@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] [BUGS] BUG #14759: insert into foreign data partitionsfail  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers
On 2017/08/01 12:45, Etsuro Fujita wrote:
> On 2017/08/01 10:18, Amit Langote wrote:
>> Good points; fixed in the updated patch.
> 
> I should have mentioned this in an earlier mail, but one thing I noticed
> is this:
> 
> -    the remote server.
> +    the remote server.  That becomes especially important if the table is
> +    being used in a partition hierarchy, where it is recommended to add
> +    a constraint matching the partition constraint expression on
> +    the remote table.
> 
> I think this would apply to CHECK constraints on foreign tables when
> implementing partitioning with inheritance.  Why do we only mention this
> for partition constraints?

One thing to consider might be that while a user can mark user-defined
CHECK constraints as being NOT VALID so that the planner doesn't consider
them during constraint exclusion, the same cannot be done for internally
generated partition constraints.

Maybe, (for time being?), the planner should be taught to disregard
foreign tables' partition constraint (if any) for constraint exclusion.

> Other than that, the patch looks good to me.

Thanks for the review.

Thanks,
Amit




pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: [HACKERS] Update comments in nodeModifyTable.c
Next
From: "Tokuda, Takashi"
Date:
Subject: [HACKERS] Improve the performance of the standby server when dropping tableson the primary server