Re: UNION in a VIEW? - Mailing list pgsql-sql

From Josh Berkus
Subject Re: UNION in a VIEW?
Date
Msg-id web-34027@davinci.ethosmedia.com
Whole thread Raw
In response to Re: UNION in a VIEW?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom, Gordon,

> 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...

Hmmm ... I'm pretty used an external WHERE clause being applied to the
output of the view, rather than pushed down into the member selects of
the UNION, in the same way as if the UNION query were a subselect.
Coming from a SQL Server background, I'd actually find the suggested
behavior rather confusing (as well as tough for you guys to implement).

-Josh



______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [7.0.3] optimizing a LIKE query ...
Next
From: "Gordon A. Runkle"
Date:
Subject: Re: UNION in a VIEW?