BUG #15166: PL/PGSQL default rowtype variable value is null but alsonot null

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #15166: PL/PGSQL default rowtype variable value is null but alsonot null
Дата
Msg-id 152426142167.459.1224353227133000998@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-bugs
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)


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

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: BUG #14863: wrong reltuples statistics after vacuum withoutanalyze
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null