Re: SEARCH and CYCLE clauses

Поиск
Список
Период
Сортировка
Искать
От
Vik Fearing
Тема
Re: SEARCH and CYCLE clauses
Дата
Msg-id
8c185a24-9a8a-29b0-8acd-27613b963078@postgresfriends.org
Ответ на
Список
Дерево обсуждения
SEARCH and CYCLE clauses Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: SEARCH and CYCLE clauses Vik Fearing <vik@postgresfriends.org>
Re: SEARCH and CYCLE clauses Vik Fearing <vik@postgresfriends.org>
Re: SEARCH and CYCLE clauses Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: SEARCH and CYCLE clauses Vik Fearing <vik@postgresfriends.org>
Re: SEARCH and CYCLE clauses Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: SEARCH and CYCLE clauses Vik Fearing <vik@postgresfriends.org>
Re: SEARCH and CYCLE clauses Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: SEARCH and CYCLE clauses Vik Fearing <vik@postgresfriends.org>
Re: SEARCH and CYCLE clauses Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: SEARCH and CYCLE clauses Robert Haas <robertmhaas@gmail.com>
Re: SEARCH and CYCLE clauses Pavel Stehule <pavel.stehule@gmail.com>
Re: SEARCH and CYCLE clauses Pavel Stehule <pavel.stehule@gmail.com>
Re: SEARCH and CYCLE clauses Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: SEARCH and CYCLE clauses Pavel Stehule <pavel.stehule@gmail.com>
Re: SEARCH and CYCLE clauses Pavel Stehule <pavel.stehule@gmail.com>
Re: SEARCH and CYCLE clauses Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Re: SEARCH and CYCLE clauses Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: SEARCH and CYCLE clauses Pavel Stehule <pavel.stehule@gmail.com>
Re: SEARCH and CYCLE clauses Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: SEARCH and CYCLE clauses Pavel Stehule <pavel.stehule@gmail.com>
Re: SEARCH and CYCLE clauses Pavel Stehule <pavel.stehule@gmail.com>
On 5/22/20 12:40 PM, Vik Fearing wrote:
>>> 2)
>>> This query is an infinite loop, as expected:
>>>
>>>    with recursive a as (select 1 as b union all select b from a)
>>>    table a;
>>>
>>> But it becomes an error when you add a cycle clause to it:
>>>
>>>    with recursive a as (select 1 as b union all table a)
>>>      cycle b set c to true default false using p
>>>    table a;
>>>
>>>    ERROR:  each UNION query must have the same number of columns
>> table a expands to select * from a, and if you have a cycle clause, then
>> a has three columns, but the other branch of the union only has one, so
>> that won't work anymore, will it?
> It seems there was a copy/paste error here.  The first query should have
> been the same as the second but without the cycle clause.
> 
> It seems strange to me that adding a  would
> break a previously working query.  I would rather see the * expanded
> before adding the new columns.  This is a user's opinion, I don't know
> how hard that would be to implement.


After thinking about it quite a bit more, I have changed my mind on
this.  The transformation does add columns to the 
and so TABLE or SELECT * should see them.  Especially since they see
them from outside of the wle.
-- 
Vik Fearing


В списке pgsql-hackers по дате отправления
От: Gilles Darold
Дата:
От: Vik Fearing
Дата:
Сообщение: Re: SEARCH and CYCLE clauses
FAQ