pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G. Johnston <david.g.johnston@gmail.com>
To: Smith, Travis <Travis.Smith@iriworldwide.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13875: Error explaining query
Date: Tue, 19 Jan 2016 07:34:31 -0700
Message-ID: <CAKFQuwYLjrt3G2Hgp0z-RRP_C8Km8XCA2H_rTeTEOcP_bRR7EA@mail.gmail.com> (raw)
In-Reply-To: <BY2PR0101MB0840287BED606A6E6CE07028F4C10@BY2PR0101MB0840.prod.exchangelabs.com>
References: <20160118160535.2972.70055@wrigleys.postgresql.org>
	<29170.1453177060@sss.pgh.pa.us>
	<BY2PR0101MB0840287BED606A6E6CE07028F4C10@BY2PR0101MB0840.prod.exchangelabs.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Tue, Jan 19, 2016 at 7:22 AM, Smith, Travis <
Travis.Smith@iriworldwide.com> wrote:

> HI Tom,
>
> Sounds good.    I would like to help with the self-contained case.    What
> do you need from me?
>
>
>
> Thank you,
> Travis
>
>
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Monday, January 18, 2016 10:18 PM
> To: Smith, Travis
> Cc: pgsql-bugs@postgresql.org
> Subject: Re: [BUGS] BUG #13875: Error explaining query
>
> travis.smith@iriworldwide.com writes:
> > =# explain select count(1) from (SELECT DISTINCT
> > "IRI_IT_M_2782_7472_O"."ATTR_VALUE",
> > "IRI_IT_M_2782_7472_O"."SORT_ORDER",
> > "IT_DIM_IRI_7472"."M_2796_KEY", "IT_DIM_IRI_7472"."M_2782_KEY" FROM
> > "IT_DIM_IRI_7472", "IRI_IT_M_2782_7472_O" WHERE
> > ("IT_DIM_IRI_7472"."S_848_KEY" = 4527492) AND
> > ("IT_DIM_IRI_7472"."M_2782_KEY" = "IRI_IT_M_2782_7472_O"."AVP_KEY")
> > ORDER BY "IT_DIM_IRI_7472"."M_2796_KEY" ASC,
> > "IRI_IT_M_2782_7472_O"."SORT_ORDER" ASC,
> > "IT_DIM_IRI_7472"."M_2782_KEY" ASC  ) t;
>
> > ERROR:  variable not found in subplan target list
>
> What I get is
>
> ERROR:  relation "IT_DIM_IRI_7472" does not exist LINE 4:
> "IT_DIM_IRI_7472", "IRI_IT_M_2782_7472_O" WHERE
>         ^
>

​Ideally, something like:

WITH data_cte AS (
​VALUES (), (), (), ...​
)​
SELECT *
FROM data_cte

Where the main select causes the relevant error.

Otherwise a "psql" script file with the various and sundry CREATE TABLE,
CREATE INDEX, INSERT, SELECT statements that, when fed into "psql", cause
the error.

David J.

view thread (9+ messages)  latest in thread

Message-ID: <CAKFQuwYLjrt3G2Hgp0z-RRP_C8Km8XCA2H_rTeTEOcP_bRR7EA@mail.gmail.com>
Permalink:  ../CAKFQuwYLjrt3G2Hgp0z-RRP_C8Km8XCA2H_rTeTEOcP_bRR7EA@mail.gmail.com/
Also on:    postgresql.org/message-id/CAKFQuwYLjrt3G2Hgp0z-RRP_C8Km8XCA2H_rTeTEOcP_bRR7EA@mail.gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david.g.johnston@gmail.com, Travis.Smith@iriworldwide.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #13875: Error explaining query
  In-Reply-To: <CAKFQuwYLjrt3G2Hgp0z-RRP_C8Km8XCA2H_rTeTEOcP_bRR7EA@mail.gmail.com>
  References: <20160118160535.2972.70055@wrigleys.postgresql.org> <29170.1453177060@sss.pgh.pa.us> <BY2PR0101MB0840287BED606A6E6CE07028F4C10@BY2PR0101MB0840.prod.exchangelabs.com> <CAKFQuwYLjrt3G2Hgp0z-RRP_C8Km8XCA2H_rTeTEOcP_bRR7EA@mail.gmail.com>

* 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