X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A3229D955B for ; Mon, 7 Nov 2005 09:07:55 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 53578-03 for ; Mon, 7 Nov 2005 13:07:50 +0000 (GMT) X-Greylist: delayed 00:06:39.769914 by SQLgrey- Received: from biglumber.com (biglumber.com [207.228.252.42]) by svr1.postgresql.org (Postfix) with SMTP id 35350D6837 for ; Mon, 7 Nov 2005 09:07:51 -0400 (AST) Received: (qmail 21100 invoked from network); 7 Nov 2005 13:01:15 -0000 Received: from unknown (HELO localhost) (207.228.252.42) by 0 with SMTP; 7 Nov 2005 13:01:15 -0000 From: "Greg Sabino Mullane" To: pgsql-interfaces@postgresql.org Subject: Re: DBD::Pg returns 1/0 for boolean field ... X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: <20051107011444.B993@ganymede.hub.org> Date: Mon, 7 Nov 2005 13:01:15 -0000 X-Mailer: JoyMail 1.48 Message-ID: <3e14564a674680c2b4cf85a667261cb1@biglumber.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.08 required=5 tests=[AWL=0.080] X-Spam-Score: 0.08 X-Spam-Level: X-Archive-Number: 200511/7 X-Sequence-Number: 5803 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > Am I doing something wrong, that DBD::Pg is "converting" it > to 1's and 0's? Or is this expected? That's expected: in Perl (and many other languages), both raw 't' and 'f' are considered "true", so DBD::Pg does some mapping. Very handy when you are passing things back and forth. You can turn this behavior off with the pg_bool_tf attribute like this: $dbh->{pg_bool_tf} = 1; The default is 0. I'm going to move the explanation for this higher up on the DBD::Pg docs page. - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200511070758 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFDb1AZvJuQZxSWSsgRAj5VAKDSgrNIeTUAlDNEjs1mfQ7ygqkSewCfdkEv A8jdzpObzN5D8xA4dYIjmZ8= =l8T8 -----END PGP SIGNATURE-----