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