pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Haworth <pmh@edison.ioppublishing.com>
To: Henrik Steffen <steffen@city-map.de>
To: pgsql-general@postgresql.org
Subject: Re: boolean 't' 'f' vs. '1' '0' - perl question
Date: Tue, 31 Dec 2002 15:11:27 +0000
Message-ID: <PGM.20021231151127.541.2834@edison.ioppublishing.com> (raw)
References: <018001c2b0d7$712013a0$7100a8c0@henrik>

On Tue, 31 Dec 2002 15:18:08 +0100, Henrik Steffen wrote:
> I am just trying to (finally) upgrade from Pg.pm to
> DBI (DBD::Pg) ...
> 
> Until today, Pg.pm delivered a 't' or a 'f' for
> true or false boolean values.
> 
> Since the upgrade, DBI delivers a '1' or a '0'.
> 
> Question: Does anyone know if there's possibly a
> parameter to set to tell DBI to deliver 't' and 'f'
> instead of '1' and '0' ?

Not in the current version. It looks like it should be easy enough to hack,
though. Just remove lines 1360-1362 of dbdimp.c:

            if (16 == type) {
               *val = (*val == 'f') ? '0' : '1'; /* bool: translate postgres into perl */
            }

This will probably mean that tests will fail, but looks harmless enough
otherwise.


-- 
	Peter Haworth	pmh@edison.ioppublishing.com
"I don't have to impress you.  And as you're an emacs weenie who
 doesn't even speak Martian Swahili, I would never expect to."
		-- Tom Christiansen



view thread (6+ messages)  latest in thread

Message-ID: <PGM.20021231151127.541.2834@edison.ioppublishing.com>
Permalink:  ../PGM.20021231151127.541.2834@edison.ioppublishing.com/
Also on:    postgresql.org/message-id/PGM.20021231151127.541.2834@edison.ioppublishing.com

 · 

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: pmh@edison.ioppublishing.com, steffen@city-map.de
  Subject: Re: boolean 't' 'f' vs. '1' '0' - perl question
  In-Reply-To: <PGM.20021231151127.541.2834@edison.ioppublishing.com>
  References: <018001c2b0d7$712013a0$7100a8c0@henrik> <PGM.20021231151127.541.2834@edison.ioppublishing.com>

* 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