Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prHzW-0004B6-LX for pgsql-general@arkaria.postgresql.org; Tue, 25 Apr 2023 12:41:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1prHzV-0005LK-JB for pgsql-general@arkaria.postgresql.org; Tue, 25 Apr 2023 12:41:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prHzV-0005LA-8J for pgsql-general@lists.postgresql.org; Tue, 25 Apr 2023 12:41:53 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1prHzS-001oTv-DT for pgsql-general@lists.postgresql.org; Tue, 25 Apr 2023 12:41:52 +0000 Received: from [132.174.172.2] (helo=pureos) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prHzP-0002U8-CM; Tue, 25 Apr 2023 14:41:47 +0200 Date: Tue, 25 Apr 2023 14:41:45 +0200 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: DBD::Pg (version 3.16.3) returns EMPTY char columns as 'undef' Message-ID: Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 13.0-CURRENT r368166 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 132.174.172.2 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, We're using the above DBD::Pg version on Linux together with PostgreSQL 15.1 On fetch empty char columns are returned as (Perl) 'undef' while ( my @row_ary = $dba->FetchArray()) { foreach my $i (0..$#row_ary) { if ($row_ary[$i] eq undef) { print $row_ary[1] . "\n"; next; } ... which later leads in our code to NULL values '\N' in the writing of a CSV-like export files. Ofc NULL values in the database are something else as '' char strings. How this must be distinguished with DBD::Pg? Thanks matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub