PHP.nl

pg_set_error_verbosity

pg_set_error_verbosity

Determines the verbosity of messages returned by pg_last_error and pg_result_error

int **pg_set_error_verbosity** PgSql\Connection $connection int $verbosity
Determines the verbosity of messages returned by  
and .

pg_last_error``pg_result_error

sets the verbosity mode, returning the connection's previous 

setting. In mode, returned messages include severity, primary text, and position only; this will normally fit on a single line. The default mode () produces messages that include the above plus any detail, hint, or context fields (these may span multiple lines). The mode includes all available fields. Changing the verbosity does not affect the messages available from already-existing result objects, only subsequently-created ones. pg_set_error_verbosity``PGSQL_ERRORS_TERSE``PGSQL_ERRORS_DEFAULT``PGSQL_ERRORS_VERBOSE

connection``verbosity The required verbosity: ,

   or .
  `PGSQL_ERRORS_TERSE``PGSQL_ERRORS_DEFAULT``PGSQL_ERRORS_VERBOSE`

The previous verbosity level: ,

or . PGSQL_ERRORS_TERSE``PGSQL_ERRORS_DEFAULT``PGSQL_ERRORS_VERBOSE

Voorbeeld: example

<?php
  $dbconn = pg_connect("dbname=publisher") or die("Could not connect");

  if (!pg_connection_busy($dbconn)) {
      pg_send_query($dbconn, "select * from doesnotexist;");
  }
  
  pg_set_error_verbosity($dbconn, PGSQL_ERRORS_VERBOSE);
  $res1 = pg_get_result($dbconn);
  echo pg_result_error($res1);
?>

pg_last_error``pg_result_error