From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: cdalxndr@yahoo.com
Subject: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null
Date: Fri, 20 Apr 2018 21:57:01 +0000
Message-ID: <152426142167.459.1224353227133000998@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15166
Logged by: Alex
Email address: cdalxndr@yahoo.com
PostgreSQL version: 10.3
Operating system: Windows 10 version 1709
Description:
Running the following script will report that 'var' is null but also not
null:
create table test_table();
create function test() returns void as $$
declare
var test_table%rowtype;
begin
raise notice 'is null: %', (var is null);
raise notice 'is not null: %', (var is not null);
end;
$$ LANGUAGE plpgsql;
select test()
produces output:
NOTICE: is null: t
NOTICE: is not null: t
By documentation, it should be null: "If the DEFAULT clause is not given
then the variable is initialized to the SQL null value."
(https://www.postgresql.org/docs/current/static/plpgsql-declarations.html)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, cdalxndr@yahoo.com
Subject: Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null
In-Reply-To: <152426142167.459.1224353227133000998@wrigleys.postgresql.org>
References: <152426142167.459.1224353227133000998@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox