Re: Suspected bug: outer WHERE reordered before inner WHERE -> input syntax ERROR

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Suspected bug: outer WHERE reordered before inner WHERE -> input syntax ERROR
Дата
Msg-id 20080908170901.GF4411@alvh.no-ip.org
обсуждение исходный текст
Ответ на Suspected bug: outer WHERE reordered before inner WHERE -> input syntax ERROR  (John Keith Hohm <john@hohm.net>)
Список pgsql-general
John Keith Hohm wrote:

> select * from (
>   select * from (VALUES ('100'), ('JOHN')) as A (n)
>   where trim(trim(n), '0123456789') = ''
> ) as B where n::integer <> -1;

> I'm also interested in responses of the form "why not just do X?".

Why not just add an "OFFSET 0" in the subselect so that the optimizer
does not flatten the query?

 select * from (
   select * from (VALUES ('100'), ('JOHN')) as A (n)
   where trim(trim(n), '0123456789') = ''
 offset 0) as B where n::integer <> -1;


--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

В списке pgsql-general по дате отправления:

Предыдущее
От: John Keith Hohm
Дата:
Сообщение: Suspected bug: outer WHERE reordered before inner WHERE -> input syntax ERROR
Следующее
От: justin
Дата:
Сообщение: Automated Backup On Windows