Class PostgresNotice
PostgreSQL notices are non-critical messages generated by PostgreSQL, either as a result of a user query (e.g. as a warning or informational notice), or due to outside activity (e.g. if the database administrator initiates a "fast" database shutdown).
Inheritance
Namespace: Npgsql
Assembly: Npgsql.dll
Syntax
public sealed class PostgresNotice
Remarks
Constructors
| Improve this Doc View SourcePostgresNotice(string, string, string, string, string?, string?, int, int, string?, string?, string?, string?, string?, string?, string?, string?, string?, string?)
Creates a new instance.
Declaration
public PostgresNotice(string messageText, string severity, string invariantSeverity, string sqlState, string? detail = null, string? hint = null, int position = 0, int internalPosition = 0, string? internalQuery = null, string? where = null, string? schemaName = null, string? tableName = null, string? columnName = null, string? dataTypeName = null, string? constraintName = null, string? file = null, string? line = null, string? routine = null)
Parameters
Type | Name | Description |
---|---|---|
string | messageText | |
string | severity | |
string | invariantSeverity | |
string | sqlState | |
string? | detail | |
string? | hint | |
int | position | |
int | internalPosition | |
string? | internalQuery | |
string? | where | |
string? | schemaName | |
string? | tableName | |
string? | columnName | |
string? | dataTypeName | |
string? | constraintName | |
string? | file | |
string? | line | |
string? | routine |
Remarks
| Improve this Doc View SourcePostgresNotice(string, string, string, string)
Creates a new instance.
Declaration
public PostgresNotice(string severity, string invariantSeverity, string sqlState, string messageText)
Parameters
Type | Name | Description |
---|---|---|
string | severity | |
string | invariantSeverity | |
string | sqlState | |
string | messageText |
Remarks
Properties
| Improve this Doc View SourceCode
The SQLSTATE code for the error.
Declaration
public string Code { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
Always present. See https://www.postgresql.org/docs/current/static/errcodes-appendix.html
ColumnName
If the error was associated with a specific table column, the name of the column. (Refer to the schema and table name fields to identify the table.)
Declaration
public string? ColumnName { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
PostgreSQL 9.3 and up.
ConstraintName
If the error was associated with a specific constraint, the name of the constraint. Refer to fields listed above for the associated table or domain. (For this purpose, indexes are treated as constraints, even if they weren't created with constraint syntax.)
Declaration
public string? ConstraintName { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
PostgreSQL 9.3 and up.
DataTypeName
If the error was associated with a specific data type, the name of the data type. (Refer to the schema name field for the name of the data type's schema.)
Declaration
public string? DataTypeName { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
PostgreSQL 9.3 and up.
Detail
An optional secondary error message carrying more detail about the problem. May run to multiple lines.
Declaration
public string? Detail { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
| Improve this Doc View SourceFile
The file name of the source-code location where the error was reported.
Declaration
public string? File { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
PostgreSQL 9.3 and up.
Hint
An optional suggestion what to do about the problem. This is intended to differ from Detail in that it offers advice (potentially inappropriate) rather than hard facts. May run to multiple lines.
Declaration
public string? Hint { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
| Improve this Doc View SourceInternalPosition
This is defined the same as the Position field, but it is used when the cursor position refers to an internally generated command rather than the one submitted by the client. The InternalQuery field will always appear when this field appears. 0 means not provided.
Declaration
public int InternalPosition { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
| Improve this Doc View SourceInternalQuery
The text of a failed internally-generated command. This could be, for example, a SQL query issued by a PL/pgSQL function.
Declaration
public string? InternalQuery { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
| Improve this Doc View SourceInvariantSeverity
Severity of the error or notice, not localized. Always present since PostgreSQL 9.6.
Declaration
public string InvariantSeverity { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
| Improve this Doc View SourceLine
The line number of the source-code location where the error was reported.
Declaration
public string? Line { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
| Improve this Doc View SourceMessageText
The primary human-readable error message. This should be accurate but terse.
Declaration
public string MessageText { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Always present.
Position
The field value is a decimal ASCII integer, indicating an error cursor position as an index into the original query string. The first character has index 1, and positions are measured in characters not bytes. 0 means not provided.
Declaration
public int Position { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
| Improve this Doc View SourceRoutine
The name of the source-code routine reporting the error.
Declaration
public string? Routine { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
| Improve this Doc View SourceSchemaName
If the error was associated with a specific database object, the name of the schema containing that object, if any.
Declaration
public string? SchemaName { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
PostgreSQL 9.3 and up.
Severity
Severity of the error or notice. Always present.
Declaration
public string Severity { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
| Improve this Doc View SourceSqlState
The SQLSTATE code for the error.
Declaration
public string SqlState { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Always present. See https://www.postgresql.org/docs/current/static/errcodes-appendix.html
TableName
Table name: if the error was associated with a specific table, the name of the table. (Refer to the schema name field for the name of the table's schema.)
Declaration
public string? TableName { get; set; }
Property Value
Type | Description |
---|---|
string? |
Remarks
PostgreSQL 9.3 and up.
Where
An indication of the context in which the error occurred. Presently this includes a call stack traceback of active PL functions. The trace is one entry per line, most recent first.
Declaration
public string? Where { get; set; }
Property Value
Type | Description |
---|---|
string? |