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