PHP pg_fetch_* with wrong return types
<p>I have a problem with my PgSQL adapter. I'm using the native driver and the methods pg_fetch_* only return strings, even if the column type is integer or boolean.</p>

<p>For integers, is not a big problem, it's just a simple cast.</p>

<p>The real problem is with boolean values, because it's returned the strings 't' for TRUE and 'f' for FALSE.</p>

<p>Ok, the simple solution is make a verification for this every single time I have boolean fields, but it's not the smartest one...</p>

<p>One specific case is that I want migrate an huge application running on MySQL do PgSQL and would be a lot of conditionals that I'd have to change.</p>

<p>I tried to found something on Google, but (I don't know if I used the wrong keyword combination) was UNsuccessfull.</p>

<p>Sample code:</p>

<pre><code>$db = pg_connect("host=localhost dbname=**** user=**** password=**** port=5432") or die("Could not connect");
pg_set_error_verbosity(PGSQL_ERRORS_VERBOSE);
$sql = 'SELECT * FROM mesa';
$result = pg_query($db, $sql);
var_dump(pg_last_error($db));

$data = array();
while($row = pg_fetch_assoc($result)) {
    $data[] = $row;
}
var_dump($data);
</code></pre>

<p>The output:</p>

<pre><code>array (size=10)
  0 =&gt; 
    array (size=3)
    'numero' =&gt; string '2' (length=1)
    'max_pessoas' =&gt; string '8' (length=1)
    'status' =&gt; string 't' (length=1)
1 =&gt; 
    array (size=3)
    'numero' =&gt; string '3' (length=1)
    'max_pessoas' =&gt; string '8' (length=1)
    'status' =&gt; string 't' (length=1)
</code></pre>

<p>And keep going, but 'numero' is a integer, 'status' is a boolean.</p>
