PgNotice
Represents a notice or warning message received from the PostgreSQL backend.
A NoticeResponse carries the same field set as an ErrorResponse, so this holds the same fields ServerErrorMessage does, under the same names. Which of them arrive depends on what raised the notice: file, line and routine come with every one, while schema, table, column, datatype and constraint are what RAISE ... USING puts there.
Constructors
Properties
The constraint it concerns.
The equivalent position within internalQuery.
The server-generated statement the notice arose in, such as the body of a PL/pgSQL function.
The same severity as the server translated it, which is what a non-English lc_messages changes. Fit for showing to a person, not for comparing against.
Process id of the backend serving this connection, the one that raised the notice. It is not a field of the NoticeResponse message - the driver carries it over from the BackendKeyData received at startup, so a notice arriving before that one reports -1. That window is a single message wide and nothing reaches it at the default verbosity; connecting with client_min_messages=debug5 fills it with the backend's own catalog-reading transaction. What it is for is a handler shared between connections: a Kotlin object NoticeHandler sees the notices of every connection in a pool, and this is what tells them apart. Note that PgNotification carries a process id of its own meaning something else - the foreign backend that executed NOTIFY, not this connection's.