HDBC-postgresql-2.2.3.0: PostgreSQL driver for HDBC

Portabilityportable
Stabilityprovisional
MaintainerJohn Goerzen <jgoerzen@complete.org>

Database.HDBC.PostgreSQL

Contents

Description

HDBC driver interface for PostgreSQL 8.x

Written by John Goerzen, jgoerzen@complete.org

NOTE ON DATES AND TIMES

The recommended correspondence between PostgreSQL date and time types and HDBC SqlValue types is:

  • SqlLocalDate: DATE
  • SqlLocalTimeOfDay: TIME WITHOUT TIME ZONE
  • SqlZonedLocalTimeOfDay: TIME WITH TIME ZONE
  • SqlLocalTime: TIMESTAMP WITHOUT TIME ZONE
  • SqlZonedTime: TIMESTAMP WITH TIME ZONE
  • SqlUTCTime: TIMESTAMP WITH TIME ZONE
  • SqlDiffTime: INTERVAL
  • SqlPOSIXTime: NUMERIC
  • SqlEpochTime: INTEGER
  • SqlTimeDiff: INTERVAL

Other combinations are possible, and may even be converted automatically. The above simply represents the types that seem the most logical correspondence, and thus are tested by the HDBC-PostgreSQL test suite.

Synopsis

Connecting to Databases

connectPostgreSQL :: String -> IO ConnectionSource

Connect to a PostgreSQL server.

See http://www.postgresql.org/docs/8.1/static/libpq.html#LIBPQ-CONNECT for the meaning of the connection string.

PostgreSQL Error Codes

When an SqlError is thrown, the field seState is set to one of the following error codes.

successfulCompletion :: StringSource

Is set to "00000".

warning :: StringSource

Is set to "01000".

noData :: StringSource

Is set to "02000".

connectionException :: StringSource

Is set to "08000".

connectionDoesNotExist :: StringSource

Is set to "08003".

connectionFailure :: StringSource

Is set to "08006".

protocolViolation :: StringSource

Is set to "08P01".

featureNotSupported :: StringSource

Is set to "0A000".

locatorException :: StringSource

Is set to "0F000".

lEInvalidSpecification :: StringSource

Is set to "0F001".

invalidGrantor :: StringSource

Is set to "0L000".

invalidGrantOperation :: StringSource

Is set to "0LP01".

cardinalityViolation :: StringSource

Is set to "21000".

dataException :: StringSource

Is set to "22000".

arrayElementError :: StringSource

Is set to "2202E".

datetimeFieldOverflow :: StringSource

Is set to "22008".

divisionByZero :: StringSource

Is set to "22012".

errorInAssignment :: StringSource

Is set to "22005".

indicatorOverflow :: StringSource

Is set to "22022".

intervalFieldOverflow :: StringSource

Is set to "22015".

invalidArgumentForLog :: StringSource

Is set to "2201E".

invalidDatetimeFormat :: StringSource

Is set to "22007".

invalidEscapeCharacter :: StringSource

Is set to "22019".

invalidEscapeOctet :: StringSource

Is set to "2200D".

invalidEscapeSequence :: StringSource

Is set to "22025".

invalidLimitValue :: StringSource

Is set to "22020".

invalidParameterValue :: StringSource

Is set to "22023".

nullValueNotAllowed :: StringSource

Is set to "22004".

numericValueOutOfRange :: StringSource

Is set to "22003".

substringError :: StringSource

Is set to "22011".

trimError :: StringSource

Is set to "22027".

unterminatedCString :: StringSource

Is set to "22024".

floatingPointException :: StringSource

Is set to "22P01".

badCopyFileFormat :: StringSource

Is set to "22P04".

notAnXmlDocument :: StringSource

Is set to "2200L".

invalidXmlDocument :: StringSource

Is set to "2200M".

invalidXmlContent :: StringSource

Is set to "2200N".

invalidXmlComment :: StringSource

Is set to "2200S".

restrictViolation :: StringSource

Is set to "23001".

notNullViolation :: StringSource

Is set to "23502".

foreignKeyViolation :: StringSource

Is set to "23503".

uniqueViolation :: StringSource

Is set to "23505".

checkViolation :: StringSource

Is set to "23514".

invalidCursorState :: StringSource

Is set to "24000".

activeSqlTransaction :: StringSource

Is set to "25001".

readOnlySqlTransaction :: StringSource

Is set to "25006".

noActiveSqlTransaction :: StringSource

Is set to "25P01".

inFailedSqlTransaction :: StringSource

Is set to "25P02".

sqlRoutineException :: StringSource

Is set to "2F000".

invalidCursorName :: StringSource

Is set to "34000".

savepointException :: StringSource

Is set to "3B000".

sEInvalidSpecification :: StringSource

Is set to "3B001".

invalidCatalogName :: StringSource

Is set to "3D000".

invalidSchemaName :: StringSource

Is set to "3F000".

transactionRollback :: StringSource

Is set to "40000".

tRSerializationFailure :: StringSource

Is set to "40001".

tRDeadlockDetected :: StringSource

Is set to "40P01".

syntaxError :: StringSource

Is set to "42601".

insufficientPrivilege :: StringSource

Is set to "42501".

cannotCoerce :: StringSource

Is set to "42846".

groupingError :: StringSource

Is set to "42803".

invalidForeignKey :: StringSource

Is set to "42830".

invalidName :: StringSource

Is set to "42602".

nameTooLong :: StringSource

Is set to "42622".

reservedName :: StringSource

Is set to "42939".

datatypeMismatch :: StringSource

Is set to "42804".

indeterminateDatatype :: StringSource

Is set to "42P18".

wrongObjectType :: StringSource

Is set to "42809".

undefinedColumn :: StringSource

Is set to "42703".

undefinedFunction :: StringSource

Is set to "42883".

undefinedTable :: StringSource

Is set to "42P01".

undefinedParameter :: StringSource

Is set to "42P02".

undefinedObject :: StringSource

Is set to "42704".

duplicateColumn :: StringSource

Is set to "42701".

duplicateCursor :: StringSource

Is set to "42P03".

duplicateDatabase :: StringSource

Is set to "42P04".

duplicateFunction :: StringSource

Is set to "42723".

duplicatePstatement :: StringSource

Is set to "42P05".

duplicateSchema :: StringSource

Is set to "42P06".

duplicateTable :: StringSource

Is set to "42P07".

duplicateAlias :: StringSource

Is set to "42712".

duplicateObject :: StringSource

Is set to "42710".

ambiguousColumn :: StringSource

Is set to "42702".

ambiguousFunction :: StringSource

Is set to "42725".

ambiguousParameter :: StringSource

Is set to "42P08".

ambiguousAlias :: StringSource

Is set to "42P09".

invalidColumnReference :: StringSource

Is set to "42P10".

invalidTableDefinition :: StringSource

Is set to "42P16".

insufficientResources :: StringSource

Is set to "53000".

diskFull :: StringSource

Is set to "53100".

outOfMemory :: StringSource

Is set to "53200".

tooManyConnections :: StringSource

Is set to "53300".

programLimitExceeded :: StringSource

Is set to "54000".

statementTooComplex :: StringSource

Is set to "54001".

tooManyColumns :: StringSource

Is set to "54011".

tooManyArguments :: StringSource

Is set to "54023".

objectInUse :: StringSource

Is set to "55006".

cantChangeRuntimeParam :: StringSource

Is set to "55P02".

lockNotAvailable :: StringSource

Is set to "55P03".

operatorIntervention :: StringSource

Is set to "57000".

queryCanceled :: StringSource

Is set to "57014".

adminShutdown :: StringSource

Is set to "57P01".

crashShutdown :: StringSource

Is set to "57P02".

cannotConnectNow :: StringSource

Is set to "57P03".

ioError :: StringSource

Is set to "58030".

undefinedFile :: StringSource

Is set to "58P01".

duplicateFile :: StringSource

Is set to "58P02".

configFileError :: StringSource

Is set to "F0000".

lockFileExists :: StringSource

Is set to "F0001".

plpgsqlError :: StringSource

Is set to "P0000".

raiseException :: StringSource

Is set to "P0001".

noDataFound :: StringSource

Is set to "P0002".

tooManyRows :: StringSource

Is set to "P0003".

internalError :: StringSource

Is set to "XX000".

dataCorrupted :: StringSource

Is set to "XX001".

indexCorrupted :: StringSource

Is set to "XX002".