Re: pg_dump fails for views with UNION and SELECT DISTINCT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump fails for views with UNION and SELECT DISTINCT
Дата
Msg-id 9677.1024094559@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_dump fails for views with UNION and SELECT DISTINCT  (Sam O'Connor <sam@panviva.com>)
Список pgsql-bugs
"Sam O'Connor" <sam@panviva.com> writes:
> If I create a view like this:
> CREATE VIEW v AS
> SELECT i FROM a
> UNION
> SELECT DISTINCT i FROM b

> It functions as expected but it causes pg_dump to produce
> bad output. "ORDER BY b.i" is added to the view definition.

This appears to be fixed already in current sources --- the problem
is the lack of parentheses around the arms of the UNION.  There's
a difference between
    SELECT foo UNION SELECT bar ORDER BY baz;
and
    SELECT foo UNION (SELECT bar ORDER BY baz);
and the rule dumper was not being careful about it :-(

I'll see about backpatching this change for 7.2.2.

            regards, tom lane

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

Предыдущее
От: Sam O'Connor
Дата:
Сообщение: pg_dump fails for views with UNION and SELECT DISTINCT
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: PgLargeObject bug