pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Seltenreich <seltenreich@gmx.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [sqlsmith] ERROR: plan should not reference subplan's variable
Date: Fri, 01 Jul 2016 17:29:36 -0400
Message-ID: <8425.1467408576@sss.pgh.pa.us> (raw)
In-Reply-To: <874m89rw7x.fsf@credativ.de>
References: <874m89rw7x.fsf@credativ.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andreas Seltenreich <seltenreich@gmx.de> writes:
> Updating master from f8c5855..1bdae16, sqlsmith triggers "failed to
> generate plan" errors again.  Below is the smallest query logged so far.

Hmm, interesting.  This can be reduced to

set force_parallel_mode = on;

explain
with j1 as (select * from int8_tbl)
select * from int4_tbl
  where false and EXISTS (select 1 as c0 from j1);

The "plan should not reference subplan's variable" fail seems to be due
to ancient fuzzy thinking in SS_finalize_plan.  When I fix that, I get
a plan like so:

 Gather  (cost=0.00..0.00 rows=0 width=0)
   Workers Planned: 1
   Single Copy: true
   ->  Result  (cost=1.05..1.05 rows=0 width=4)
         One-Time Filter: false
         CTE j1
           ->  Seq Scan on int8_tbl  (cost=0.00..1.05 rows=5 width=16)

but if I try to actually execute the query, it crashes at runtime,
apparently because the CTE has not been passed over to the parallel
worker.  Robert, is it expected that CTEs should be parallel-safe?
I'd have thought not.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (6+ messages)  latest in thread

Message-ID: <8425.1467408576@sss.pgh.pa.us>
Permalink:  ../8425.1467408576@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8425.1467408576@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, seltenreich@gmx.de, robertmhaas@gmail.com
  Subject: Re: [sqlsmith] ERROR: plan should not reference subplan's variable
  In-Reply-To: <8425.1467408576@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox