Re: SQL-standard function body

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: SQL-standard function body
Дата
Msg-id c17ea953-0837-70ab-b408-522421697d54@2ndquadrant.com
обсуждение исходный текст
Ответ на SQL-standard function body  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: SQL-standard function body  (Jaime Casanova <jcasanov@systemguards.com.ec>)
Список pgsql-hackers
On 15.03.21 09:14, Julien Rouhaud wrote:
> On Mon, Mar 15, 2021 at 04:03:44PM +0800, Julien Rouhaud wrote:
>> On Mon, Mar 15, 2021 at 01:05:11AM -0500, Jaime Casanova wrote:
>>> I found another problem when using CASE expressions:
>>>
>>> CREATE OR REPLACE FUNCTION foo_case()
>>> RETURNS boolean
>>> LANGUAGE SQL
>>> BEGIN ATOMIC
>>>      select case when random() > 0.5 then true else false end;
>>> END;
>>>
>>> apparently the END in the CASE expression is interpreted as the END of
>>> the function
>>
>> I think that it's an issue in psql scanner.  If you escape the semicolon or
>> force a single query execution (say with psql -c), it works as expected.
> 
> Applying the following diff (not sending a patch to avoid breaking the cfbot)
> the issue and doesn't seem to break anything else:

Right.  Here is a new patch with that fix added and a small conflict 
resolved.

Вложения

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

Предыдущее
От: Prabhat Sahu
Дата:
Сообщение: Re: [Patch] ALTER SYSTEM READ ONLY
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?