pg_getlastoid/pg_last_oid don't work by default on Postgres 8 as OID isn't available on a table by default. Please consider modifying Insert_ID using the following declaration of the Insert_ID function. There is an optional parameter, seq that is the sequence name to be queried. If one isn't provided, the function falls back on its old operation providing backwards compatibility.
For adodbSQL_drivers/postgres8/postgres8_driver.inc
=== BEGIN CODE ===
function Insert_ID($seq=NULL)
{
if ($seq === NULL) {
return @pg_getlastoid($this->record_set);
} else {
// Prepare a query for execution
$seq = '"' . trim('"', $seq) . '"';
$result = pg_prepare($this->connectionId, "get_my_seq_val", 'SELECT currval($1)');
$result = pg_execute($this->connectionId, "get_my_seq_val", array($seq));
if ($result === FALSE || pg_num_rows($result) == 0) {
return FALSE;
} else {
$value = pg_fetch_result($result, 0, 0);
pg_free_result($result);
return $value;
}
}
}
=== END CODE ===
Remove the following line from the suggested patch. My apologies.
$seq = '"' . trim('"', $seq) . '"';