Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xDqKp-00000000l7i-3ysF for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Oct 2026 21:34:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xDqKo-0000000DFwG-1MdW for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Oct 2026 21:34:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xDqKo-0000000DFw8-0LpM for pgsql-bugs@lists.postgresql.org; Mon, 05 Oct 2026 21:34:58 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xDqKl-00000000b72-1Llv for pgsql-bugs@lists.postgresql.org; Mon, 05 Oct 2026 21:34:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 695LYkqB1201949; Mon, 5 Oct 2026 17:34:46 -0400 From: Tom Lane To: kehan5800@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19747: pg_dump does not pin array_nulls, so restore mangles NULL array elements In-reply-to: <19747-69b01e7fc190cd58@postgresql.org> References: <19747-69b01e7fc190cd58@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 04 Oct 2026 05:19:03 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1201947.1791236086.1@sss.pgh.pa.us> Date: Mon, 05 Oct 2026 17:34:46 -0400 Message-ID: <1201948.1791236086@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > pg_dump writes a null array element as the unquoted word NULL. Whether the > array input function reads that as a null depends on array_nulls, which is > PGC_USERSET and can be persisted with ALTER DATABASE/ROLE ... SET. The > dump's preamble (_doSetFixedOutputState(), src/bin/pg_dump/ > pg_backup_archiver.c:3431) pins the other input-side settings > (client_encoding, standard_conforming_strings, check_function_bodies, > xmloption, row_security, ...) but not array_nulls, so the restoring session > inherits the target database's value. Meh. TBH, that GUC was past its shelf life ten years ago. What I'd rather do about this report is just summarily remove the GUC. If we make pg_dump issue a SET for it then we'll never be able to remove it. We could alternatively do what we've done with some other GUCs whose time has passed: force them to have constant values and accept SET commands only when the value matches. But I doubt that this one ever got widespread enough use to justify doing that much work. I'd rather just nuke it from orbit. regards, tom lane