Re: BUG #13875: Error explaining query

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "Smith, Travis" <Travis(dot)Smith(at)iriworldwide(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13875: Error explaining query
Date: 2016-01-19 14:34:31
Message-ID: CAKFQuwYLjrt3G2Hgp0z-RRP_C8Km8XCA2H_rTeTEOcP_bRR7EA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jan 19, 2016 at 7:22 AM, Smith, Travis <
Travis(dot)Smith(at)iriworldwide(dot)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(at)sss(dot)pgh(dot)pa(dot)us]
> Sent: Monday, January 18, 2016 10:18 PM
> To: Smith, Travis
> Cc: pgsql-bugs(at)postgresql(dot)org
> Subject: Re: [BUGS] BUG #13875: Error explaining query
>
> travis(dot)smith(at)iriworldwide(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Smith, Travis 2016-01-19 15:02:00 Re: BUG #13875: Error explaining query
Previous Message Smith, Travis 2016-01-19 14:22:52 Re: BUG #13875: Error explaining query