DBD::Pg returns 1/0 for boolean field ... - Mailing list pgsql-interfaces

From Marc G. Fournier
Subject DBD::Pg returns 1/0 for boolean field ...
Date
Msg-id 20051107011444.B993@ganymede.hub.org
Whole thread Raw
Responses Re: DBD::Pg returns 1/0 for boolean field ...  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-interfaces
'k, not sure if I'm overlooking something obvious here, but the query 
below, when run through psql, returns 't' or 'f', as I'd expect:
   SELECT vm.path, vm.company_id, vs.ip_address_id, vm.path AS root_path,          vm.vm_template_id, vt.mount_union
FROM vm_status vs
 
LEFT JOIN virtual_machine vm ON (vs.virtual_machine_id = vm.id)
LEFT JOIN vm_template vt ON (vm.vm_template_id = vt.id)    WHERE vs.stop_date IS NULL      AND vs.server_id IN (SELECT
id                            FROM server                            WHERE server_name = ?
ANDstatus_id = '1' );
 

But, when I run it DBI/DBD::Pg, I'm getting 1's and 0's ...

I'm reading the results as:

$get_hosts->execute($hostname);
$host_array = $get_hosts->fetchall_arrayref({});
foreach my $row (@$host_array) {

and printing the results as:
  print $row->{'mount_union'} . "\n";  next;

Am I doing something wrong, that DBD::Pg is "converting" it to 1's and 
0's?  Or is this expected?


----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664


pgsql-interfaces by date:

Previous
From: Vita Voom Software
Date:
Subject: Released pgExpress Driver v3.50
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: DBD::Pg returns 1/0 for boolean field ...