Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aLXMk-0006Xy-KI for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jan 2016 14:34:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aLXMj-0003es-Tb for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jan 2016 14:34:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aLXMj-0003em-Ix for pgsql-bugs@postgresql.org; Tue, 19 Jan 2016 14:34:37 +0000 Received: from mail-io0-x231.google.com ([2607:f8b0:4001:c06::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aLXMg-00074L-4y for pgsql-bugs@postgresql.org; Tue, 19 Jan 2016 14:34:36 +0000 Received: by mail-io0-x231.google.com with SMTP id 77so550924624ioc.2 for ; Tue, 19 Jan 2016 06:34:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LDGn0AejiiVgxBOtqNlL49+Nrsx7T6smWssWRaK2z1c=; b=grOAgQJB7ThfsbwofAO2TBVMPHUCP/GuymXuydZZ+0AvaHYd2CPLbPsDeEWep5vr1j sGREAhy1x7gTVJj4ne9dDErI4qjzgaAd12rQFibm257db2sqsBTKVlmnOHoOLEX7QK1L rwqxDTJc928gy/uckhTTDGInL7VvG6Srghb/FOsEEDoL3Sib+80WMPaQux/v3WL3XfFU HNAcsp2Exi9Cw8B8uvpUrSAP+s66jFsZyRt3HyXFajxgnUiXXDgUKwi6KCWHnK7DV0lB Z0xTmnl2ePxeiVpUCc0vTCJazMHCuo+XKO4tF/bMQJ5ph2T0dcRCcb6cUU1h0Jt2k1y0 uShA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LDGn0AejiiVgxBOtqNlL49+Nrsx7T6smWssWRaK2z1c=; b=lDcbNYgiBcJNZ/Q83gcY3pEBUa4pch4x2UZCahtMcVwmTWxV6/Zrai4BMJiSDZe1Gb tZRcUVrQGZe7wn1SdxQvVd/4yOIbrWDSekH/VGytgdmhILl1lfkQmkdvViD8pUf8iDyP HK0vo6XV7zqI7LZJaO1ngKrMDxtDe83QRwYKr4r/4CMKaBbxG+mkrnLesd/Ciw8nerNt iIyRvAME4Fp1uJeoKLtLOel98VjTm3HBbI4SLgTx/zboIj4zPAO3jJ6MBAyQdS4vYHSE XGztOm1GK+NPLTthyiYnzMVM34DjhUQct8HWX58TC95kOZMqrBIa1QyoMiPv8hSLR+Zk hBFw== X-Gm-Message-State: ALoCoQm0Q7bbknno1rTbqQDkS/ULLhQAcrEJFtqzQyQ1KzadSb+SdDg7IwX6G9OO2wQOFywCPet/u4xmCvmQttZ36KVf/z0EzQ== MIME-Version: 1.0 X-Received: by 10.107.135.35 with SMTP id j35mr30528209iod.47.1453214071804; Tue, 19 Jan 2016 06:34:31 -0800 (PST) Received: by 10.36.153.196 with HTTP; Tue, 19 Jan 2016 06:34:31 -0800 (PST) In-Reply-To: References: <20160118160535.2972.70055@wrigleys.postgresql.org> <29170.1453177060@sss.pgh.pa.us> Date: Tue, 19 Jan 2016 07:34:31 -0700 Message-ID: Subject: Re: BUG #13875: Error explaining query From: "David G. Johnston" To: "Smith, Travis" Cc: Tom Lane , "pgsql-bugs@postgresql.org" Content-Type: multipart/alternative; boundary=001a113ec9948858200529b0c400 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --001a113ec9948858200529b0c400 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. Wha= t > 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: > > =3D# 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" =3D 4527492) AND > > ("IT_DIM_IRI_7472"."M_2782_KEY" =3D "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 > ^ > =E2=80=8BIdeally, something like: WITH data_cte AS ( =E2=80=8BVALUES (), (), (), ...=E2=80=8B )=E2=80=8B 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. --001a113ec9948858200529b0c400 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Ja= n 19, 2016 at 7:22 AM, Smith, Travis <Travis.Smith@iriworldwide.com> wrote:
HI To= m,

Sounds good.=C2=A0 =C2=A0 I would like to help with the self-contained case= .=C2=A0 =C2=A0 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<= /a>
Subject: Re: [BUGS] BUG #13875: Error explaining query

travis.smith@iriworldwide.= com writes:
> =3D# 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_7= 472"."M_2782_KEY" FROM
> "IT_DIM_IRI_7472", "IRI_IT_M_2782_7472_O" WHERE > ("IT_DIM_IRI_7472"."S_848_KEY" =3D 4527492) AND > ("IT_DIM_IRI_7472"."M_2782_KEY" =3D "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=C2=A0 ) t;

> ERROR:=C2=A0 variable not found in subplan target list

What I get is

ERROR:=C2=A0 relation "IT_DIM_IRI_7472" does not exist LINE 4: &q= uot;IT_DIM_IRI_7472", "IRI_IT_M_2782_7472_O" WHERE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ^

=E2=80=8BIdeally, something like:

WITH data_cte AS (
=E2=80=8BVALUES (), (), (), ...=E2=80=8B
)=E2=80=8B
SELECT *
=
FROM data_cte

Where the main select causes the r= elevant 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.
--001a113ec9948858200529b0c400--