Thread: Small query yields "error: no relation entry for relid 11"

Small query yields "error: no relation entry for relid 11"

From
Tom Ellis
Date:
This small query results in "error: no relation entry for relid 11" in
Postgres 12 and 13 (beta) on db-fiddle.com.  It runs fine in Posgres
11.

Tom


SELECT 0
      FROM
      (SELECT 0) as "T1"
      LEFT OUTER JOIN
      (SELECT * FROM (SELECT *
        FROM
        (SELECT
         0) as "T1"
        LEFT OUTER JOIN
        (SELECT
         TRUE as "r") as "T2"
        ON
        TRUE) as "T1",
       LATERAL
       (SELECT
        TRUE as "b"
        UNION ALL
        SELECT
        CASE WHEN "r" THEN TRUE ELSE TRUE END as "b") as "T2"
        ) as "T2"
      ON
      "b"



Re: Small query yields "error: no relation entry for relid 11"

From
Tom Lane
Date:
Tom Ellis <tom-lists-postgresql.org@jaguarpaw.co.uk> writes:
> This small query results in "error: no relation entry for relid 11" in
> Postgres 12 and 13 (beta) on db-fiddle.com.  It runs fine in Posgres
> 11.

Cute ... fix pushed, thanks for the report!

            regards, tom lane