Re: if not exists (SELECT 1... UNION SELECT 1...)

Поиск
Список
Период
Сортировка
От Ralf Schuchardt
Тема Re: if not exists (SELECT 1... UNION SELECT 1...)
Дата
Msg-id 9F4935D6-F0D0-42BE-B26B-77F72BC74D4B@gmx.de
обсуждение исходный текст
Ответ на Re: if not exists (SELECT 1... UNION SELECT 1...)  (Alexander Farber <alexander.farber@gmail.com>)
Ответы Re: if not exists (SELECT 1... UNION SELECT 1...)  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general

On 16 Feb 2022, at 14:36, Alexander Farber wrote:

Ah, I have to do

RETURN '___WRONG___';

Not necessarily.

and not

out_text := '___WRONG___'
RETURN;

You must rather end the assignment with a semicolon:

out_text := '___WRONG___';
RETURN;

Otherwise what really happens is:

out_text := '___WRONG___' RETURN;

where „return“ is a simple column name as in this select statement:

select '___WRONG___' return;

Yours,
Ralf

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

Предыдущее
От: Alexander Farber
Дата:
Сообщение: Re: if not exists (SELECT 1... UNION SELECT 1...)
Следующее
От: Alexander Farber
Дата:
Сообщение: Re: if not exists (SELECT 1... UNION SELECT 1...)