Re: Case expression pushdown

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Case expression pushdown
Дата
Msg-id 1005527.1627660129@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Case expression pushdown  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I wrote:
> Alexander Pyhalov <a.pyhalov@postgrespro.ru> writes:
>> Do we we need to inspect only case_arg_cxt->state? Can we assert that 
>> collation == case_arg_cxt->collation?

> Perhaps, but:
> ...

Oh, actually there's a third point: the shakiest part of this logic
is the assumption that we've correctly matched a CaseTestExpr to
its source CaseExpr.  Seeing that inlining and constant-folding can
mash things to the point where a WHEN expression doesn't look like
"CaseTestExpr = RHS", it's a little nervous-making to assume there
couldn't be another CASE in between.  While there's not known problems
of this sort, if it did happen I'd prefer this code to react as
"don't push down", not as "assertion failure".

(There's been speculation in the past about whether we could find
a more bulletproof representation of this kind of CaseExpr.  We've
not succeeded at that yet though.)

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Segment fault when excuting SPI function On PG with commit 41c6a5be
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unbounded %s in sscanf