variable not found in subplan target list

From: Roger Niederland <roger(at)niederland(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: variable not found in subplan target list
Date: 2011-11-01 01:02:35
Message-ID: 4EAF452B.8080707@niederland.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I stripped down the original query to what is below. I am not saying
that the query below
is useful except to show an error I am getting in Postgresql 9.1.1 on
both SL6.1 (64 bit) and
Windows 2008 server 9.1.1 (32-bit and 64-bit). The error I am getting is:

ERROR: variable not found in subplan target list
SQL state: XX000

If I remove the inner join to person (at the end) to works on 9.1.1

I tried this query on Postgresql 9.1.0 on Windows Vista (32-bit) and it
works.
Also on the postgres 8.4 it works on both OS's.

Thanks,
Roger

SELECT
COALESCE(FreshUps.employeeId, Appts.employeeId) AS employeeId
FROM
(
SELECT
COALESCE(Ups.employeeId, -1) AS employeeId
FROM
(
SELECT Lead.salesmanId AS employeeId
FROM Lead
GROUP BY Lead.salesmanID) AS Ups
) AS FreshUps
FULL OUTER JOIN
(
SELECT
COALESCE(Ups.employeeId, -1) AS employeeId
FROM
(
SELECT SalesAppointment.SalesmanID AS employeeID
FROM SalesAppointment
GROUP BY SalesAppointment.SalesmanID) AS Ups
) AS Appts USING (employeeId)

INNER JOIN Employee USING (employeeid)
INNER JOIN Person ON Employee.employeeId = Person.personId

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2011-11-01 01:23:14 Can I track DB connections through a generic acct on the basis of linux idsid
Previous Message Bill Thoen 2011-10-31 23:57:45 Re: Need Help With a A Simple Query That's Not So Simple