query syntax change?

From: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
To: pggeneral <pgsql-general(at)postgreSQL(dot)org>
Subject: query syntax change?
Date: 2001-07-06 16:59:22
Message-ID: 3B45EE6A.332F566D@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This query works in 7.0.3...

SELECT p.*, e.id AS "employee_id", e.ref_name,
e.business_line_id, e.record_status_id AS "emp_record_status_id"
FROM person p, employee e
WHERE e.person_id = p.id

UNION ALL

SELECT p.*, NULL AS "employee_id", NULL AS "ref_name",
NULL AS "business_line_id", NULL AS "emp_record_status_id"
FROM person p
WHERE NOT EXISTS (SELECT id FROM employee WHERE person_id = p.id)
ORDER BY p.sortable_last_name;

but in 7.1.2 it reports the following error:

ERROR: Relation 'p' does not exist

Anyone understand why?

Regards,
Ed Loehr

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jared H. Hudson 2001-07-06 17:25:21 SELECT'ing a function call
Previous Message Richard Huxton 2001-07-06 16:42:23 Re: Vacuum and Transactions