Class PgException

All Implemented Interfaces:
Serializable

public class PgException extends DatabaseException
PostgreSQL error including all fields of the ErrorResponse message of the PostgreSQL frontend/backend protocol.
Author:
Julien Viet
See Also:
  • Constructor Details

  • Method Details

    • getErrorMessage

      public String getErrorMessage()
      Returns:
      the primary human-readable error message ('M' field)
    • getSeverity

      public String getSeverity()
      Returns:
      the severity: ERROR, FATAL, or PANIC, or a localized translation of one of these ('S' field)
    • getSqlState

      public String getSqlState()
      Description copied from class: DatabaseException
      SQL State (XOPEN or SQL:2003 conventions).
      Overrides:
      getSqlState in class DatabaseException
      Returns:
      the SQLSTATE code for the error ('S' field, value list), it is never localized
    • getDetail

      public String getDetail()
      Returns:
      an optional secondary error message carrying more detail about the problem ('D' field), a newline indicates paragraph break.
    • getHint

      public String getHint()
      Returns:
      an optional suggestion (advice) what to do about the problem ('H' field), a newline indicates paragraph break.
    • getPosition

      public String getPosition()
      Returns:
      a decimal ASCII integer, indicating an error cursor position as an index into the original query string. ('P' field). The first character has index 1, and positions are measured in characters not bytes.
    • getWhere

      public String getWhere()
      Returns:
      an indication of the context in which the error occurred ('W' field). Presently this includes a call stack traceback of active procedural language functions and internally-generated queries. The trace is one entry per line, most recent first.
    • getFile

      public String getFile()
      Returns:
      file name of the source-code location where the error was reported ('F' field).
    • getLine

      public String getLine()
      Returns:
      line number of the source-code location where the error was reported ('L' field).
    • getRoutine

      public String getRoutine()
      Returns:
      name of the source-code routine reporting the error ('R' field).
    • getSchema

      public String getSchema()
      Returns:
      if the error was associated with a specific database object, the name of the schema containing that object, if any ('s' field).
    • getTable

      public String getTable()
      Returns:
      if the error was associated with a specific table, the name of the table ('t' field).
    • getColumn

      public String getColumn()
      Returns:
      if the error was associated with a specific table column, the name of the column ('c' field).
    • getDataType

      public String getDataType()
      Returns:
      if the error was associated with a specific data type, the name of the data type ('d' field).
    • getConstraint

      public String getConstraint()
      Returns:
      if the error was associated with a specific constraint, the name of the constraint ('n' field).
    • getInternalPosition

      public String getInternalPosition()
      Returns:
      a decimal ASCII integer, indicating an error cursor position ('p' field) as an index into the internally generated command (see 'q' field).
    • getInternalQuery

      public String getInternalQuery()
      Returns:
      the text of a failed internally-generated command ('q' field).