Re: Recursive CTE and collation

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема Re: Recursive CTE and collation
Дата
Msg-id CAKoxK+7ajThOyQ3q1b2DhxehafRQWHR8t_FBu496XY1qsQ+bJw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Recursive CTE and collation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Fri, Jun 14, 2019 at 5:19 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I took a closer look at the code to refresh my memory about this,
> and the actual rule for recursive unions is that the output of
> the union has to have the same column types/collations that were
> inferred from the non-recursive (first) side alone.  This is needed
> because when we do parse analysis of the recursive side, those
> types/collations are what we'll assume for any references to the
> recursive union's result.  It's too late to change those decisions
> when we find out what the UNION actually produces.

Thanks for taking time and effort to explain this really interesting
piece of code.

> Obviously there's more than one way you could fix the mismatch, but
> I think that changing the NULL to type "name" is the nicest.

I've fixed the query both on the post and in my repository, thanks.
Thanks also to Sebastien for pointing out my error.

Luca



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #15853: DROP TABLE CASCADE drops sequence that other tablesdepend on
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #15853: DROP TABLE CASCADE drops sequence that other tablesdepend on