pg_error fixed to pg_last_error