db_error()
Determine whether the previous query caused an error.
includes/database.pgsql.inc, line 220
<?php function db_error() { global $active_db; return pg_last_error($active_db); } ?>