A way to refer to the "outer" query implicitly? - Mailing list pgsql-general

From Greg Stark
Subject A way to refer to the "outer" query implicitly?
Date
Msg-id 87ad2cxumt.fsf@stark.xeocode.com
Whole thread Raw
Responses Re: A way to refer to the "outer" query implicitly?
List pgsql-general
My code constructs some queries by passing in constraint clauses like
 type = 'A'

However one of the constraint clauses is
 exists (select 1 from othertable where x = outertable.x)

This works fine, but requires that the caller know that the table being
queried will be "outertable". Is there any way in a subquery used like this to
implicitly reference fields from the outer query?

--
greg

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Generate char surrogate key
Next
From: Tom Lane
Date:
Subject: Re: pg_dump on older version of postgres eating huge