Re: replace_vars_with_subplan_refs

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Michal Schwarz <misch(at)czechin(dot)cz>
Cc: "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: replace_vars_with_subplan_refs
Date: 2002-04-16 19:26:10
Message-ID: 200204161926.g3GJQAq28314@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Please upgrade to 7.2.1. It is fixed there.

---------------------------------------------------------------------------

Michal Schwarz wrote:
> Problem:
> --------
> SELECT * FROM <view> returns following error message:
> ERROR: replace_vars_with_subplan_refs: variable not in subplan target list
>
> Environment:
> ------------
> Version: PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.95.2
> System: Linux jtam.brno.czechin.cz 2.2.17-RAID #8 SMP Mon Oct 16 10:48:13
> CEST 2000 i686 unknown
>
> Exact steps to reproduce this bug:
> ----------------------------
> CREATE TABLE "fs_ucastnici" (
> "id" integer DEFAULT nextval('"fs_ucastnici_id_seq"'::text) NOT
> NULL,
> "jmeno" character varying(50),
> "email" character varying(40),
> Constraint "fs_ucastnici_pkey" Primary Key ("id")
> );
> CREATE SEQUENCE "fs_ucastnici_id_seq" start 1 increment 1 maxvalue
> 2147483647 minvalue 1 cache 1;
>
> CREATE TABLE "userdb" (
> "username" character varying(16) NOT NULL,
> "email" text,
> "name" character varying(80)
> );
> CREATE UNIQUE INDEX userdb_pkey ON userdb USING btree (username);
>
> CREATE TABLE "emaily" (
> "email" text NOT NULL,
> "jmeno" text,
> "akce" character varying(40) NOT NULL,
> Constraint "emaily_pkey" Primary Key ("email")
> );
>
> CREATE VIEW "infomail" as
> SELECT DISTINCT ON (lower(vsichni.email)) vsichni.email,
> vsichni.jmeno, vsichni.id, vsichni.odkud FROM (
> SELECT fs_ucastnici.email, fs_ucastnici.jmeno,
> fs_ucastnici.id::text AS id, 'soutez' AS odkud FROM ONLY fs_ucastnici
> UNION
> SELECT userdb.email, userdb.name, (userdb.username)::text AS
> username, 'userdb' FROM ONLY userdb
> UNION
> SELECT emaily.email, emaily.jmeno, ''::text, 'emaily'
> FROM ONLY emaily WHERE (emaily.akce = 'add')
> ) vsichni
> WHERE (vsichni.email ~ '@'::text)
> ORDER BY lower(vsichni.email);
>
> When this schema exists, try:
>
> SELECT * FROM infomail;
>
> On my system, it fails with "ERROR: replace_vars_with_subplan_refs:
> variable not in subplan target list".
>
>
>
> bye,
> Michal Schwarz
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2002-04-16 19:27:08 Re: Case sensitivity in psql/pg_dump
Previous Message Stephan Szabo 2002-04-16 17:18:52 Re: [HACKERS] Foreign Key woes -- 7.2 and ~7.3