Re: UNION index use help

From: "Dmitri Bichko" <dbichko(at)aveopharma(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: UNION index use help
Date: 2005-10-06 17:25:50
Message-ID: F18A6F7CF1661F46920F2CF713122FED46CCC6@mail.aveo.aveopharma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

That's exactly it - thanks, works perfectly now!

For the record, it's 8.0.3

Dmitri

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Sent: Thursday, October 06, 2005 12:32 PM
> To: Dmitri Bichko
> Cc: pgsql-sql(at)postgresql(dot)org
> Subject: Re: [SQL] UNION index use help
>
>
> "Dmitri Bichko" <dbichko(at)aveopharma(dot)com> writes:
> > Ok, I'm thoroughly confused.
>
> You didn't say which PG version you are using, but if it's
> something reasonably recent then it should be able to push
> upper qual conditions down into a UNION. I think you are
> getting bit by this restriction:
>
> * 3. For subqueries using UNION/UNION
> ALL/INTERSECT/INTERSECT ALL, we can
> * push quals into each component query, but the quals can
> only reference
> * subquery columns that suffer no type coercions in the set
> operation.
> * Otherwise there are possible semantic gotchas.
>
> You're getting burnt because you're unioning a text with a
> varchar. Make the column types the same and it'll work better.
>
> regards, tom lane
>
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Sullivan 2005-10-06 18:15:12 Re: DATESTYLE and 0000-00-00
Previous Message Tom Lane 2005-10-06 16:32:17 Re: UNION index use help