Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null
Date
Msg-id 19263.1524323676@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-bugs
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> That could be considered a slight bug in the documentation, because what
> actually happens for rowtype variables is that they are initialized to a
> row value with all null columns, NOT to the null value.

Right, if they're declared as a named composite type rather than RECORD.

> Also, it looks like this behavior changes in pg11, probably not
> intentionally.

For the record, it was entirely intentional, cf

https://postgr.es/m/8962.1514399547@sss.pgh.pa.us

As of commit 4b93f5799, both named-composite and RECORD variables
are initialized to simple NULLs, not ROW(NULL,NULL,...).

            regards, tom lane


pgsql-bugs by date:

Previous
From: Alex
Date:
Subject: Re: BUG #15166: PL/PGSQL default rowtype variable value is null butalso not null
Next
From: Сергей
Date:
Subject: postgres 10.3 no response