Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13759 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74529 invoked by uid 1010); 7 Nov 2004 01:20:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74470 invoked from network); 7 Nov 2004 01:20:25 -0000 Received: from unknown (HELO mail.trippynames.com) (38.113.223.19) by pb1.pair.com with SMTP; 7 Nov 2004 01:20:25 -0000 Received: from localhost (localhost [127.0.0.1]) by mail.trippynames.com (Postfix) with ESMTP id 5C6AFA6C76 for ; Sat, 6 Nov 2004 17:20:24 -0800 (PST) Received: from mail.trippynames.com ([127.0.0.1]) by localhost (rand.nxad.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 76134-06 for ; Sat, 6 Nov 2004 17:20:23 -0800 (PST) Received: from [192.168.1.4] (dsl081-069-073.sfo1.dsl.speakeasy.net [64.81.69.73]) by mail.trippynames.com (Postfix) with ESMTP id 2433FA6C73 for ; Sat, 6 Nov 2004 17:20:23 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v619) Content-Transfer-Encoding: 7bit Message-ID: <30EB6453-305B-11D9-80C2-000A95C705DC@chittenden.org> Content-Type: text/plain; charset=US-ASCII; format=flowed To: internals@lists.php.net Date: Sat, 6 Nov 2004 17:20:20 -0800 X-Mailer: Apple Mail (2.619) Subject: PostgreSQL driver handles boolean values incorrectly... From: sean@chittenden.org (Sean Chittenden) Howdy. Was doing some development with PHP and PostgreSQL and came across a rather nasty surprise. A boolean value is returned as the strings 't' and 'f', not the constants true and false. This presents all kinds of interesting oddities for code that does something like: $r = pg_query("SELECT FALSE"); list($b) = pg_fetch_row($r); if ($b) echo "This gets displayed 100% of the time because %b is the string 'f'\n"; else echo "This never gets displayed: $b is always true\n"; The same problem lies with the NULL value, which IMHO, should be mapped to the constant NULL, not the string 'NULL'. I took a first stab at handling this, but have been by and large unsuccessful, so I'm posting here instead of submitting a complete solution. My patches can be found at the URL below: http://people.FreeBSD.org/~seanc/patches/php/ Any help/assistance is appreciated. I thought I was doing the right thing, but am apparently not. Please advise. Thanks in advance. -sc -- Sean Chittenden