| От | Tom Lane |
|---|---|
| Тема | Re: UNION index use help |
| Дата | |
| Msg-id | 20942.1128616337@sss.pgh.pa.us обсуждение |
| Ответ на | UNION index use help ("Dmitri Bichko" <dbichko@aveopharma.com>) |
| Список | pgsql-sql |
"Dmitri Bichko" <dbichko@aveopharma.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
thequals can only reference* subquery columns that suffer no type coercions in the set operation.* Otherwise there are
possiblesemantic 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
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера