From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gordon A. Runkle <gar@integrated-dynamics.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: UNION in a VIEW?
Date: Wed, 04 Apr 2001 18:13:21 -0400
Message-ID: <12713.986422401@sss.pgh.pa.us> (raw)
In-Reply-To: <9ag0u5$svd$1@news.tht.net>
References: <9ag0u5$svd$1@news.tht.net>
"Gordon A. Runkle" <gar@integrated-dynamics.com> writes:
> I have a number of views that I'm bringing over from DB2 which
> have UNIONs in them. Some of the UNIONs have joins.
> The views are not working as expected (I'm running 7.1RC2).
> It appears that the where clause being applied to the view
> by the user is not being distributed properly to the selects.
You're correct, an outer WHERE clause will not be pushed down into
the member selects of a UNION. (This hasn't really got anything
to do with whether a VIEW is involved.) I haven't gotten round to
convincing myself about whether that transformation is always valid,
or what conditions it needs to be valid. A TODO item for some
future release...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, gar@integrated-dynamics.com
Subject: Re: UNION in a VIEW?
In-Reply-To: <12713.986422401@sss.pgh.pa.us>
References: <9ag0u5$svd$1@news.tht.net> <12713.986422401@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox