Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, Rushabh Lathia <rushabh.lathia@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Robert Haas <robertmhaas@gmail.com>, Phil Florent <philflorent@hotmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-08-08T15:48:12Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Match RelOptInfos by relids not pointer equality.

  2. Fix run-time partition pruning for appends with multiple source rels.

David Rowley <david.rowley@2ndquadrant.com> writes:
> On 8 August 2018 at 17:28, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
>> Attached is a patch which modifies the if test to compare relids instead
>> of RelOptInfo pointers.

> Thanks for investigating and writing a patch. I agree with the fix.

I changed this to compare the relid sets not just rel->relid, since
rel->relid is only reliable for baserels.  The partitioned rel could
safely be assumed to be a baserel, but I'm less comfortable with
supposing that the parentrel always will be.  Otherwise, added a
test case based on Rushabh's example and pushed.  (I'm not quite
sure if the plan will be stable enough to satisfy the buildfarm,
but we'll soon find out ...)

			regards, tom lane