Re: Another DBD::Pg question - Mailing list pgsql-general

From Rob Arnold
Subject Re: Another DBD::Pg question
Date
Msg-id 001e01c1067e$18941b50$4901010a@canrion.net
Whole thread Raw
In response to Another DBD::Pg question  (Mithun Bhattacharya <mithun.b@egurucool.com>)
List pgsql-general
Boolean values fetched into a perl scalar are always going to be one of
these three values:

1 if Pg says 't'
0 if Pg says 'f'
undef if Pg says null  (note that null is NOT false)

--rob



----- Original Message -----
From: "Mithun Bhattacharya" <mithun.b@egurucool.com>
To: "PostgreSQL general" <pgsql-general@postgresql.org>
Sent: Friday, July 06, 2001 10:25 AM
Subject: Another DBD::Pg question


> This time perldoc DBD::Pg says :
> ----------------
>        Data-Type bool
>
>        The current implementation of PostgreSQL returns 't' for
>        true and 'f' for false. From the perl point of view a
>        rather unfortunate choice. The DBD-Pg module translates
>        the result for the data-type bool in a perl-ish like
>        manner: 'f' -> '0' and 't' -> '1'. This way the
>        application does not have to check the database-specific
>        returned values for the data-type bool, because perl
>        treats '0' as false and '1' as true.
>
>        PostgreSQL Version 6.2 considers the input 't' as true and
>        anything else as false.  PostgreSQL Version 6.3 considers
>        the input 't', '1' and 1 as true and anything else as
>        false.  PostgreSQL Version 6.4 considers the input 't',
>        '1' and 'y' as true and any other character as false.
> ----------------
>
> Anyone using DBD::PG version 1.00 with PostGreSQL version 7.1.2 ?? If so
> whats the interpretation of true in that.. The Author doesnt say what
> his current implementation is.
>
>
>
> Mithun
>


pgsql-general by date:

Previous
From: "Rob Arnold"
Date:
Subject: Re: Newbie DBD::Pg question
Next
From: Bruce Momjian
Date:
Subject: Bad news for Open Source databases, acording to survey