Re: [BUGS] plpgsql bug: `EXECUTE(sql_command) INTO rec` returnssometimes a NULL-able, sometimes not

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [BUGS] plpgsql bug: `EXECUTE(sql_command) INTO rec` returnssometimes a NULL-able, sometimes not
Дата
Msg-id CAFj8pRBE25f75ZiuMLoGh5Xod+zzePqH-s0f3x9rN-H1P3Jomw@mail.gmail.com
обсуждение исходный текст
Ответ на [BUGS] plpgsql bug: `EXECUTE(sql_command) INTO rec` returns sometimes aNULL-able, sometimes not  (Manuel Pradal <manuel.pradal@gmail.com>)
Ответы Re: [BUGS] plpgsql bug: `EXECUTE(sql_command) INTO rec` returnssometimes a NULL-able, sometimes not  (Manuel Pradal <manuel.pradal@gmail.com>)
Список pgsql-bugs


2017-04-24 17:48 GMT+02:00 Manuel Pradal <manuel.pradal@gmail.com>:
Hi,

Using PL/SQL language, I saw a strange behavior using "EXECUTE(sql_command) INTO", then "IF rec IS NOT NULL THEN" statement.
It seems that record content infers with existence test of whole record.

You can see in attached file the possible bug in action.

Should I use "IF NOT FOUND" syntax? Is it more reliable?

The result should be NULL - but test on NULL is true, only when all fields are NULL. Can you send some examples?

you should to use GET DIAGNOSTICS statement. Variable FOUND is not related to dynamic SQL


Regards

Pavel



Thank you in advance!

Manuel PRADAL


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


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

Предыдущее
От: Manuel Pradal
Дата:
Сообщение: [BUGS] plpgsql bug: `EXECUTE(sql_command) INTO rec` returns sometimes aNULL-able, sometimes not
Следующее
От: Manuel Pradal
Дата:
Сообщение: Re: [BUGS] plpgsql bug: `EXECUTE(sql_command) INTO rec` returnssometimes a NULL-able, sometimes not