pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-bugs@lists.postgresql.org
Cc: cdalxndr@yahoo.com
Subject: Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null
Date: Sat, 21 Apr 2018 11:14:36 -0400
Message-ID: <19263.1524323676@sss.pgh.pa.us> (raw)
In-Reply-To: <87wox1chvh.fsf@news-spur.riddles.org.uk>
References: <152426142167.459.1224353227133000998@wrigleys.postgresql.org>
	<87wox1chvh.fsf@news-spur.riddles.org.uk>

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




view thread (4+ messages)

Message-ID: <19263.1524323676@sss.pgh.pa.us>
Permalink:  ../19263.1524323676@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19263.1524323676@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, cdalxndr@yahoo.com
  Subject: Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null
  In-Reply-To: <19263.1524323676@sss.pgh.pa.us>
  References: <152426142167.459.1224353227133000998@wrigleys.postgresql.org> <87wox1chvh.fsf@news-spur.riddles.org.uk> <19263.1524323676@sss.pgh.pa.us>

* 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