pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthias Apitz <guru@unixarea.de>
To: pgsql-general@lists.postgresql.org
Subject: DBD::Pg (version 3.16.3) returns EMPTY char columns as 'undef'
Date: Tue, 25 Apr 2023 14:41:45 +0200
Message-ID: <ZEfKic3n/58EOpoa@pureos> (raw)


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





view thread (4+ messages)  latest in thread

Message-ID: <ZEfKic3n/58EOpoa@pureos>
Permalink:  ../ZEfKic3n%2F58EOpoa@pureos/
Also on:    postgresql.org/message-id/ZEfKic3n/58EOpoa@pureos

 · 

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-general@postgresql.org
  Cc: guru@unixarea.de
  Subject: Re: DBD::Pg (version 3.16.3) returns EMPTY char columns as 'undef'
  In-Reply-To: <ZEfKic3n/58EOpoa@pureos>
  References: <ZEfKic3n/58EOpoa@pureos>

* 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