The message output format is as follows:
Format of messages returned to an application
msgType: msgText
Format of messages output to the server message log
SQLSTATE: date [processID]: [internalCode-1] user = userName,db = dbName,remote = clientIpAddress(portNumber) app = appName msgType: msgText
See
Refer to "PostgreSQL Error Codes" under "Appendixes" in the PostgreSQL Documentation for information on SQLSTATE.
Note
Notes on monitoring messages output to the server message log
Use SQLSTATE to monitor server messages, noting the following:
Configuration method
Refer to "Error Log Settings" under "Setup" in the Installation and Setup Guide for Server for details.
Note
The user name, client IP address (port number), and application name may sometimes be blank.
Notes on monitoring messages returned to an application
You can output SQLSTATE to a message to be returned to an application. The following explains how to configure the settings for outputting SQLSTATE and gives cautions to be observed when doing so.
Configuration methods
In the SET statement, set the log_error_verbosity parameter to VERBOSE.
For an application that uses the C language library, use the PQsetErrorVerbosity function to set message redundancy to PQERRORS_VERBOSE.
Notes
SQLSTATE is output only to messages to be returned to applications that use the C language library.
In some cases, userName, clientIpAddress(portNumber), and applicationName may be blank.
If the email address "pgsql-bugs@postgresql.org" is output to the message and the cause of the error cannot be identified, contact Fujitsu technical support.
Example
Message output to the server message log
3D000: 2017-07-10 19:41:05 JST [13899]: [1-1] user = fepuser,db = fep,remote = 127.0.0.1(51902) app = [unknown] FATAL: database "fep" does not exist