plpgsql bug: `EXECUTE(sql_command) INTO rec` returns sometimes a NULL-able, sometimes not

From: Manuel Pradal <manuel(dot)pradal(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: plpgsql bug: `EXECUTE(sql_command) INTO rec` returns sometimes a NULL-able, sometimes not
Date: 2017-04-24 15:48:25
Message-ID: CABsmV8g3ENCq+YD35vVwr667CSCkAu2oudJgHBDfA67zm8_P9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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?

Thank you in advance!

Manuel PRADAL

Attachment Content-Type Size
plsql_execute_into_nullable.sql application/octet-stream 1.1 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2017-04-24 16:53:25 Re: plpgsql bug: `EXECUTE(sql_command) INTO rec` returns sometimes a NULL-able, sometimes not
Previous Message Dave Page 2017-04-24 10:32:52 Re: BUG #14630: Pgadmin window looks like simple html, no graphics