I'm trying to port a program written in ESQL/C for Informix to
PostgreSQL using ecpg [ecpg is a great helper here, despite its
shortcomings]. Right now, I'm having a hard time with OUTER JOINs,
even when using newest PostgreSQL-7.1.1.
How would you translate the following SELECT statements with
outer joins to PostgreSQL syntax?
SELECT ...
FROM tab1 alias_tab1, OUTER ot1 alias_ot1, OUTER ot2 alias_ot2
WHERE ...
SELECT ...
FROM tab1 alias_tab1, OUTER (ot1 alias_ot1, ot2 alias_ot2)
WHERE ...
It is even possible to have multiple tables specified at FROM
before the OUTER keyword, like here:
SELECT ...
FROM tab1 alias_tab1, tab2 alias_tab2,
OUTER ot1 alias_ot1,
OUTER ot2 alias_ot2
WHERE ...
SELECT
FROM tab1 alias_tab1, tab2 alias_tab2,
OUTER (ot1 alias_ot1, ot2 alias_ot2)
WHERE ...
Another situation is here (same table 'otboth' with two aliases):
SELECT ...
FROM tab1 alias_tab1, OUTER otboth alias1, OUTER otboth alias2
WHERE ...
I didn't find any clue in Bruce's book nor in the postgreSQL docs/faq
as of 7.1.1. If at all possible, I'd like to stick to OUTER JOINs
because they are used extensively throughout the program.
Thank you for your help,
-Farid.
--
Farid Hajji -- Unix Systems and Network Admin | Phone: +49-2131-67-555
Broicherdorfstr. 83, D-41564 Kaarst, Germany | farid.hajji@ob.kamp.net
- - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - -
One OS To Rule Them All And In The Darkness Bind Them... --Bill Gates.