If you're wanting to use objects for your results, but are put off because you can't seem to apply a function to each field of the result (like stripslashes for example), try this code:
<?php
// Code to connect, do query etc etc...
$row = pg_fetch_object($result);
$vars = get_object_vars($row);
foreach ( $vars as $key => $var )
{
$row->{$key} = stripslashes($var);
}
?>