Complete list of field codes from libpq documentation...
Warning : they are prefixed with "PG_", just change to "PGSQL_" and they'll be available as defined PHP values.
For me, most importants fields are suffixed with a star ;)
PG_DIAG_SEVERITY
PG_DIAG_SEVERITY_NONLOCALIZED *
PG_DIAG_SQLSTATE *
PG_DIAG_MESSAGE_PRIMARY
PG_DIAG_MESSAGE_DETAIL
PG_DIAG_MESSAGE_HINT
PG_DIAG_STATEMENT_POSITION
PG_DIAG_INTERNAL_POSITION
PG_DIAG_INTERNAL_QUERY
PG_DIAG_CONTEXT
PG_DIAG_SCHEMA_NAME *
PG_DIAG_TABLE_NAME *
PG_DIAG_COLUMN_NAME *
PG_DIAG_DATATYPE_NAME *
PG_DIAG_CONSTRAINT_NAME
PG_DIAG_SOURCE_FILE
PG_DIAG_SOURCE_LINE
PG_DIAG_SOURCE_FUNCTION
Source and field codes details : https://www.postgresql.org/docs/current/libpq-exec.html