Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9uDq-0005Hb-Fb for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Apr 2018 15:14:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f9uDp-0003az-5k for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Apr 2018 15:14:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9uDo-0003ao-VY for pgsql-bugs@lists.postgresql.org; Sat, 21 Apr 2018 15:14:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9uDm-0001t9-H7 for pgsql-bugs@lists.postgresql.org; Sat, 21 Apr 2018 15:14:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w3LFEajb019264; Sat, 21 Apr 2018 11:14:36 -0400 From: Tom Lane To: Andrew Gierth cc: pgsql-bugs@lists.postgresql.org, cdalxndr@yahoo.com Subject: Re: BUG #15166: PL/PGSQL default rowtype variable value is null but also not null In-reply-to: <87wox1chvh.fsf@news-spur.riddles.org.uk> References: <152426142167.459.1224353227133000998@wrigleys.postgresql.org> <87wox1chvh.fsf@news-spur.riddles.org.uk> Comments: In-reply-to Andrew Gierth message dated "Sat, 21 Apr 2018 05:45:40 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19262.1524323676.1@sss.pgh.pa.us> Date: Sat, 21 Apr 2018 11:14:36 -0400 Message-ID: <19263.1524323676@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andrew Gierth 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