pg_result_error_field     (PHP 5 >= 5.1.0RC1)
pg_result_error_field -- Returns an individual field of an error report.
Description string 
pg_result_error_field  ( resource result, int fieldcode )
   pg_result_error_field()  returns one of the detailed error message
   fields associated with result  resource. It is only available
   against a PostgreSQL 7.4 or above server.  The error field is specified by
   the fieldcode .
  
   Because pg_query() pg_query_params() FALSE pg_send_query() pg_get_result() 
   If you need to get additional error information from failed pg_query() pg_set_error_verbosity() pg_last_error() 
Parameters 
   
result 
       A PostgreSQL query result resource from a previously executed
       statement.
      
fieldcode 
         Possible fieldcode  values are: PGSQL_DIAG_SEVERITY PGSQL_DIAG_SQLSTATE PGSQL_DIAG_MESSAGE_PRIMARY PGSQL_DIAG_MESSAGE_DETAIL PGSQL_DIAG_MESSAGE_HINT PGSQL_DIAG_STATEMENT_POSITION PGSQL_DIAG_INTERNAL_POSITION PGSQL_DIAG_INTERNAL_QUERY PGSQL_DIAG_CONTEXT PGSQL_DIAG_SOURCE_FILE PGSQL_DIAG_SOURCE_LINE PGSQL_DIAG_SOURCE_FUNCTION 
Return Values A string NULL FALSE 
Examples 
   
Example 1. pg_result_error_field()  example 
<?php =  pg_connect ( "dbname=publisher" ) or die( "Could not connect" ); pg_connection_busy ( $dbconn )) { pg_send_query ( $dbconn ,  "select * from doesnotexist;" ); $res1  =  pg_get_result ( $dbconn ); pg_result_error_field ( $res1 ,  PGSQL_DIAG_SQLSTATE ); ?>