pdo_pgsql_error(dbh, qs);
return 0;
}
+ H->pgoid = PQoidValue(res);
}
return 1;
return 1;
}
+static long pdo_pgsql_last_insert_id(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+
+ if (H->pgoid == InvalidOid) {
+ return -1;
+ }
+
+ return (long) H->pgoid;
+}
static struct pdo_dbh_methods pgsql_methods = {
pgsql_handle_closer,
NULL,
NULL,
NULL,
- NULL,
+ pdo_pgsql_last_insert_id,
pdo_pgsql_fetch_error_func
};
}
H->attached = 1;
+ H->pgoid = -1;
dbh->methods = &pgsql_methods;
dbh->alloc_own_columns = 1;