From: Catalin Pitis <cpitis.pgsql@gmail.com>
To: pgsql-sql@postgresql.org
Subject: ERROR: plan should not reference subplan's variable
Date: Tue, 2 May 2006 22:13:53 +0300
Message-ID: <63c4c13c0605021213t4a3d5591m2a62dd3389009bb0@mail.gmail.com> (raw)
Hi *
I'm trying to run the following SQL statement on a PostgreSQL 8.1, installed
on a Windows machine:
INSERT INTO PROJECT(PROJECT_ID,PROJECT_DESC)
(
SELECT MAX(PROJECT_ID),'MYPROJECT'
FROM PROJECT
WHERE NOT EXISTS
(
SELECT PROJECT_DESC FROM PROJECT WHERE PROJECT_DESC = 'MYPROJECT'
)
)
and I get the following error:
ERROR: plan should not reference subplan's variable
If, for example, I replace MAX with some other aggregation (e.g. AVG or
SUM), everything works ok.
The table DDL looks like:
CREATE TABLE project
(
project_id int4 NOT NULL,
project_desc varchar(255),
CONSTRAINT project_pkey PRIMARY KEY (project_id)
)
WITH OIDS;
Do you have any clue why does this happen?
Thanks,
Catalin
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-sql@postgresql.org
Cc: cpitis.pgsql@gmail.com
Subject: Re: ERROR: plan should not reference subplan's variable
In-Reply-To: <63c4c13c0605021213t4a3d5591m2a62dd3389009bb0@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