Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, cdalxndr(at)yahoo(dot)com
Subject: Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null
Date: 2018-04-21 15:14:36
Message-ID: 19263.1524323676@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Сергей 2018-04-22 04:28:09 postgres 10.3 no response
Previous Message Alex 2018-04-21 07:51:37 Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null