Re: pgsql: Expand partitioned table RTEs level by level, without flattening

Andreas Seltenreich <seltenreich@gmx.de>

From: Andreas Seltenreich <seltenreich@gmx.de>
To: Robert Haas <rhaas@postgresql.org>
Cc: pgsql-committers@postgresql.org
Date: 2017-09-16T10:55:46Z
Lists: pgsql-hackers
Robert Haas writes:

> Expand partitioned table RTEs level by level, without flattening.

testing with sqlsmith shows that the following assertion in this commit
doesn't hold:

TRAP: FailedAssertion("!(((brel)->reloptkind == RELOPT_BASEREL || (brel)->reloptkind == RELOPT_OTHER_MEMBER_REL))", File: "initsplan.c", Line: 647)

One of the simpler queries that triggers it for me:

    select from information_schema.user_mapping_options;

regards,
Andreas


Commits

  1. Fix create_lateral_join_info to handle dead relations properly.

  2. Expand partitioned table RTEs level by level, without flattening.