Обсуждение: ERROR: plan should not reference subplan's variable
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'
)
)
(
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;
(
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
"Catalin Pitis" <cpitis.pgsql@gmail.com> writes: > ERROR: plan should not reference subplan's variable > Do you have any clue why does this happen? It's a bug :-(. Thanks for the test case --- I'll look into it tonight or tomorrow, if no one beats me to it. regards, tom lane
"Catalin Pitis" <cpitis.pgsql@gmail.com> writes: > ERROR: plan should not reference subplan's variable I've applied a patch for this; will be in 8.1.4. http://archives.postgresql.org/pgsql-committers/2006-05/msg00016.php regards, tom lane
Hi Tom
Could you tell me when will 8.1.4 be released with the problem solved?
Thanks,
Catalin
On 5/3/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Catalin Pitis" <cpitis.pgsql@gmail.com> writes:
> ERROR: plan should not reference subplan's variable
I've applied a patch for this; will be in 8.1.4.
http://archives.postgresql.org/pgsql-committers/2006-05/msg00016.php
regards, tom lane
On Wed, May 03, 2006 at 08:08:22AM +0300, Catalin Pitis wrote: > Hi Tom > > Could you tell me when will 8.1.4 be released with the problem solved? In general, you can't rely on hard release dates in a free software project. Given that's in the STABLE branch, however, you could get it directly from CVS and build it yourself. Directions for doing this are on the website (possibly in the developer's section, note). A -- Andrew Sullivan | ajs@crankycanuck.ca The whole tendency of modern prose is away from concreteness. --George Orwell