Re: Re: Fixing bug #8228 ("set-valued function called in context that cannot accept a set")

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: Fixing bug #8228 ("set-valued function called in context that cannot accept a set")
Дата
Msg-id 31688.1389070182@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Fixing bug #8228 ("set-valued function called in context that cannot accept a set")  (David Johnston <polobo@yahoo.com>)
Список pgsql-hackers
David Johnston <polobo@yahoo.com> writes:
> I guess backward-compatibility concerns forces this solution but after
> thinking through what was happening I was leaning more toward making both
> queries fail.  An SRF in a CASE expression seems like a foot-gun to me.

Not really.  The cause of the problem in your example is not that the CASE
contains a SRF, but that one arm of the CASE returns a set and the other
does not.  There is maybe some argument for making that situation fail ---
essentially, making SETOF be a core part of expression type
identification, such that you can't unify setof text with plain text.
But given that that works in most cases, and was only broken by a
performance optimization added to FuncExpr evaluation (by me :-(),
I think removing the unwarranted assumption from that optimization is the
right thing.  I'd definitely not wish to break cases that work as expected
today, but being stricter about expression types would do that.
        regards, tom lane



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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Get more from indices.
Следующее
От: David Rowley
Дата:
Сообщение: Re: cleanup in code