PostgreSQL: Features new in 7.4: SQL99 compliant error handling

  • Consistent style guide
  • Three error reporting modes: terse, default, verbose
    • libpq: Set with: PGVerbosity PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity);
01 template1=# \set VERBOSE terse
02 template1=# select 1 @# 2;
03 ERROR:  operator does not exist: integer @# integer
04 template1=# \set VERBOSE default
05 template1=# select 1 @# 2;
06 ERROR:  operator does not exist: integer @# integer
07 HINT:  No operator matches the given name and argument type(s). 
          You may need to add explicit typecasts.
08 template1=# \set VERBOSE verbose
09 template1=# select 1 @# 2;
10 ERROR:  42883: operator does not exist: integer @# integer
11 HINT:  No operator matches the given name and argument type(s). 
          You may need to add explicit typecasts.
12 LOCATION:  op_error, parse_oper.c:700
Prev

Next

Page 6