Re: [BUGS] BUG #14759: insert into foreign data partitions fail

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Murat Tuncer <mtuncer(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #14759: insert into foreign data partitions fail
Date: 2017-08-01 04:45:20
Message-ID: f5957799-371a-c398-b1d7-016c25e1e804@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Verite 2017-08-01 07:45:03 Re: Crash report for some ICU-52 (debian8) COLLATE and work_mem values
Previous Message Noah Misch 2017-08-01 04:21:39 Re: BUG #14758: Segfault with logical replication on a function index

Browse pgsql-hackers by date

  From Date Subject
Next Message Tokuda, Takashi 2017-08-01 04:45:41 Improve the performance of the standby server when dropping tables on the primary server
Previous Message Etsuro Fujita 2017-08-01 04:31:01 Re: Update comments in nodeModifyTable.c