!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                    Safe  !"#$% !"#$%  !"#$%2015 Dylan SimonNone,09:;<=DRT$1Generic class of composite (row or record) types.A  PGColumn t a4 instance describes how te decode a PostgreSQL type t to a.7Decode the PostgreSQL text representation into a value.[Decode the PostgreSQL binary representation into a value. Only needs to be implemented if  is true. A PGParameter t a4 instance describes how to encode a PostgreSQL type t from a. 3Encode a value to a PostgreSQL text representation. gEncode a value to a (quoted) literal value for use in SQL statements. Defaults to a quoted version of  _Encode a value to a PostgreSQL representation. Defaults to the text representation by pgEncode A valid PostgreSQL type, its metadata, and corresponding Haskell representation. For conversion the other way (from Haskell type to PostgreSQL), see 7. Unfortunately any instances of this will be orphans.The default, native Haskell representation of this type, which should be as close as possible to the PostgreSQL representation.5The string name of this type: specialized version of &.0Does this type support binary decoding? If so,  must be implemented for every  instance of this type.nA proxy type for PostgreSQL types. The type argument should be an (internal) name of a database type, as per format_type(OID) (usually the same as \dT+1). When the type's namespace (schema) is not in  search_pathP, this will be explicitly qualified, so you should be sure to have a consistent  search_path/ for all database connections. The underlying ' should be considered a lifted .A PostgreSQL literal identifier, generally corresponding to the "name" type (63-byte strings), but as it would be entered in a query, so may include double-quoting for special characters or schema-qualification.0Raw bytes of the identifier (should really be a (, but we need a working ) instance for annotations).Parameters that affect how marshalling happens. Currenly we force all other relevant parameters at connect time. Nothing values represent unknown.If integer_datetimes is on$; only relevant for binary encoding.HA list of (nullable) data values, e.g. a single row or query parameters.3A value passed to or from PostgreSQL in raw format.AThe standard text encoding format (also used for unknown formats)9Special binary-encoded data. Not supported in all cases.!*The literal identifier as used in a query." Reverses the * instantce.#aFinal parameter encoding function used when a (nullable) parameter is passed to a prepared query.$sFinal parameter escaping function used when a (nullable) parameter is passed to be substituted into a simple query.%@Final column decoding function used for a nullable result value.&DFinal column decoding function used for a non-nullable result value.'TProduce a SQL string literal by wrapping (and escaping) a string with single quotes.(Shorthand for + . ,)Double-quote a value if it's "", "null", or contains any whitespace, '"', '\', or the characters given in the first argument. Checking all these things may not be worth it. We could just double-quote everything.*Parse double-quoted values ala ).11The generic anonymous record type, as created by ROW. In this case we can not know the types, and in fact, PostgreSQL does not accept values of this type regardless (except as literals).:High-precision representation of Rational as numeric. Unfortunately, numeric has an NaN, while Rational does not. NaN numeric values will produce exceptions.=Representation of DiffTime as interval. PostgreSQL stores months and days separately in intervals, but DiffTime does not. We collapse all interval fields into seconds Unquoted ".Applies utf-8 encoding.-. /0 !"#$%&1'()*23456789:;+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~+  !"#$%&'()*+ !"  #$%&')*(-.  /0 !"#$%&1'()*23456789:;+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~2016 Dylan SimonSafeMA parsed SQL token.Raw (non-markup) SQL stringaA "$N" parameter placeholder (this is the only non-string-preserving token: "$012" becomes "$12")"A "${expr}" expression placeholder@A possibly-escaped question-mark: False for "?" or True for "\?"1Parse a SQL string into a series of tokens. The < implementation for , inverts this sequence back to a SQL string. Produces the original SQL string=>?@ABCDEFGHIJKL=>?@ABCDEFGHIJKL>4?42015 Dylan SimonNone,9:;<=DIMRXClass indicating that the first PostgreSQL type is a range of the second. This implies   and ' instances that will work for any type.uA end-point for a range, which may be nothing (infinity, NULL in PostgreSQL), open (inclusive), or closed (exclusive)Equivalent to Bounded False InfinityTrue! if the range includes this bound$Unbounded endpoints are always open.Construct from parts: (makeBound (boundClosed b) (bound b) == bEmpty ranges treated as Empty ranges treated as Equivalent to boundClosed . lowerBoundEquivalent to boundClosed . upperBoundCreate a point range [x,x]Extract a point: getPoint (point x) == Just x6 for discrete (non-continuous) range types, using the M instanceContains rangeContains rangeContains element%The constraint is only necessary for minBound, unfortunatelyWTakes into account open vs. closed (but does not understand equivalent discrete bounds)%The constraint is only necessary for maxBound, unfortunatelyWTakes into account open vs. closed (but does not understand equivalent discrete bounds)A+A32015 Dylan SimonNone ,9;<=?DRAConvert four bytes to network byte order, using unsafe casting. N would be better, but I couldn't find a good way to determine host byte order. SafeSUCCESSFUL_COMPLETION: 00000 (Success)WARNING: 01000 (Warning)$WARNING_DYNAMIC_RESULT_SETS_RETURNED: 0100C (Warning)!WARNING_IMPLICIT_ZERO_BIT_PADDING: 01008 (Warning)-WARNING_NULL_VALUE_ELIMINATED_IN_SET_FUNCTION: 01003 (Warning)WARNING_PRIVILEGE_NOT_GRANTED: 01007 (Warning)WARNING_PRIVILEGE_NOT_REVOKED: 01006 (Warning)$WARNING_STRING_DATA_RIGHT_TRUNCATION: 01004 (Warning)WARNING_DEPRECATED_FEATURE: 01P01 (Warning)NO_DATA: 02000 (Warning)*NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED: 02001 (Warning)SQL_STATEMENT_NOT_YET_COMPLETE: 03000 (Error)CONNECTION_EXCEPTION: 08000 (Error)CONNECTION_DOES_NOT_EXIST: 08003 (Error)CONNECTION_FAILURE: 08006 (Error)+SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION: 08001 (Error)1SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION: 08004 (Error)TRANSACTION_RESOLUTION_UNKNOWN: 08007 (Error)PROTOCOL_VIOLATION: 08P01 (Error) TRIGGERED_ACTION_EXCEPTION: 09000 (Error) FEATURE_NOT_SUPPORTED: 0A000 (Error) INVALID_TRANSACTION_INITIATION: 0B000 (Error) LOCATOR_EXCEPTION: 0F000 (Error) L_E_INVALID_SPECIFICATION: 0F001 (Error)INVALID_GRANTOR: 0L000 (Error)INVALID_GRANT_OPERATION: 0LP01 (Error)INVALID_ROLE_SPECIFICATION: 0P000 (Error)DIAGNOSTICS_EXCEPTION: 0Z000 (Error)3STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER: 0Z002 (Error)CASE_NOT_FOUND: 20000 (Error)CARDINALITY_VIOLATION: 21000 (Error)DATA_EXCEPTION: 22000 (Error)ARRAY_ELEMENT_ERROR: 2202E (Error)ARRAY_SUBSCRIPT_ERROR: 2202E (Error)CHARACTER_NOT_IN_REPERTOIRE: 22021 (Error)DATETIME_FIELD_OVERFLOW: 22008 (Error)DATETIME_VALUE_OUT_OF_RANGE: 22008 (Error)DIVISION_BY_ZERO: 22012 (Error)ERROR_IN_ASSIGNMENT: 22005 (Error)ESCAPE_CHARACTER_CONFLICT: 2200B (Error)INDICATOR_OVERFLOW: 22022 (Error)INTERVAL_FIELD_OVERFLOW: 22015 (Error) INVALID_ARGUMENT_FOR_LOG: 2201E (Error)!INVALID_ARGUMENT_FOR_NTILE: 22014 (Error)"INVALID_ARGUMENT_FOR_NTH_VALUE: 22016 (Error)##INVALID_ARGUMENT_FOR_POWER_FUNCTION: 2201F (Error)$*INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION: 2201G (Error)% INVALID_CHARACTER_VALUE_FOR_CAST: 22018 (Error)&INVALID_DATETIME_FORMAT: 22007 (Error)'INVALID_ESCAPE_CHARACTER: 22019 (Error)(INVALID_ESCAPE_OCTET: 2200D (Error))INVALID_ESCAPE_SEQUENCE: 22025 (Error)*#NONSTANDARD_USE_OF_ESCAPE_CHARACTER: 22P06 (Error)+!INVALID_INDICATOR_PARAMETER_VALUE: 22010 (Error),INVALID_PARAMETER_VALUE: 22023 (Error)-INVALID_REGULAR_EXPRESSION: 2201B (Error).!INVALID_ROW_COUNT_IN_LIMIT_CLAUSE: 2201W (Error)/)INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE: 2201X (Error)0INVALID_TABLESAMPLE_ARGUMENT: 2202H (Error)1INVALID_TABLESAMPLE_REPEAT: 2202G (Error)2$INVALID_TIME_ZONE_DISPLACEMENT_VALUE: 22009 (Error)3INVALID_USE_OF_ESCAPE_CHARACTER: 2200C (Error)4MOST_SPECIFIC_TYPE_MISMATCH: 2200G (Error)5NULL_VALUE_NOT_ALLOWED: 22004 (Error)6!NULL_VALUE_NO_INDICATOR_PARAMETER: 22002 (Error)7NUMERIC_VALUE_OUT_OF_RANGE: 22003 (Error)8STRING_DATA_LENGTH_MISMATCH: 22026 (Error)9STRING_DATA_RIGHT_TRUNCATION: 22001 (Error):SUBSTRING_ERROR: 22011 (Error); TRIM_ERROR: 22027 (Error)<UNTERMINATED_C_STRING: 22024 (Error)=ZERO_LENGTH_CHARACTER_STRING: 2200F (Error)>FLOATING_POINT_EXCEPTION: 22P01 (Error)?INVALID_TEXT_REPRESENTATION: 22P02 (Error)@INVALID_BINARY_REPRESENTATION: 22P03 (Error)ABAD_COPY_FILE_FORMAT: 22P04 (Error)BUNTRANSLATABLE_CHARACTER: 22P05 (Error)CNOT_AN_XML_DOCUMENT: 2200L (Error)DINVALID_XML_DOCUMENT: 2200M (Error)EINVALID_XML_CONTENT: 2200N (Error)FINVALID_XML_COMMENT: 2200S (Error)G"INVALID_XML_PROCESSING_INSTRUCTION: 2200T (Error)HINTEGRITY_CONSTRAINT_VIOLATION: 23000 (Error)IRESTRICT_VIOLATION: 23001 (Error)JNOT_NULL_VIOLATION: 23502 (Error)KFOREIGN_KEY_VIOLATION: 23503 (Error)LUNIQUE_VIOLATION: 23505 (Error)MCHECK_VIOLATION: 23514 (Error)NEXCLUSION_VIOLATION: 23P01 (Error)OINVALID_CURSOR_STATE: 24000 (Error)PINVALID_TRANSACTION_STATE: 25000 (Error)QACTIVE_SQL_TRANSACTION: 25001 (Error)R!BRANCH_TRANSACTION_ALREADY_ACTIVE: 25002 (Error)S)HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL: 25008 (Error)T0INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION: 25003 (Error)U4INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION: 25004 (Error)V0NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION: 25005 (Error)WREAD_ONLY_SQL_TRANSACTION: 25006 (Error)X.SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED: 25007 (Error)YNO_ACTIVE_SQL_TRANSACTION: 25P01 (Error)ZIN_FAILED_SQL_TRANSACTION: 25P02 (Error)[INVALID_SQL_STATEMENT_NAME: 26000 (Error)\TRIGGERED_DATA_CHANGE_VIOLATION: 27000 (Error)]#INVALID_AUTHORIZATION_SPECIFICATION: 28000 (Error)^INVALID_PASSWORD: 28P01 (Error)_+DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST: 2B000 (Error)`DEPENDENT_OBJECTS_STILL_EXIST: 2BP01 (Error)aINVALID_TRANSACTION_TERMINATION: 2D000 (Error)bSQL_ROUTINE_EXCEPTION: 2F000 (Error)c+S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT: 2F005 (Error)d&S_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED: 2F002 (Error)e(S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED: 2F003 (Error)f$S_R_E_READING_SQL_DATA_NOT_PERMITTED: 2F004 (Error)gINVALID_CURSOR_NAME: 34000 (Error)hEXTERNAL_ROUTINE_EXCEPTION: 38000 (Error)i"E_R_E_CONTAINING_SQL_NOT_PERMITTED: 38001 (Error)j&E_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED: 38002 (Error)k(E_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED: 38003 (Error)l$E_R_E_READING_SQL_DATA_NOT_PERMITTED: 38004 (Error)m%EXTERNAL_ROUTINE_INVOCATION_EXCEPTION: 39000 (Error)n!E_R_I_E_INVALID_SQLSTATE_RETURNED: 39001 (Error)oE_R_I_E_NULL_VALUE_NOT_ALLOWED: 39004 (Error)p!E_R_I_E_TRIGGER_PROTOCOL_VIOLATED: 39P01 (Error)qE_R_I_E_SRF_PROTOCOL_VIOLATED: 39P02 (Error)r'E_R_I_E_EVENT_TRIGGER_PROTOCOL_VIOLATED: 39P03 (Error)sSAVEPOINT_EXCEPTION: 3B000 (Error)tS_E_INVALID_SPECIFICATION: 3B001 (Error)uINVALID_CATALOG_NAME: 3D000 (Error)vINVALID_SCHEMA_NAME: 3F000 (Error)wTRANSACTION_ROLLBACK: 40000 (Error)x"T_R_INTEGRITY_CONSTRAINT_VIOLATION: 40002 (Error)yT_R_SERIALIZATION_FAILURE: 40001 (Error)z T_R_STATEMENT_COMPLETION_UNKNOWN: 40003 (Error){T_R_DEADLOCK_DETECTED: 40P01 (Error)|%SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION: 42000 (Error)} SYNTAX_ERROR: 42601 (Error)~INSUFFICIENT_PRIVILEGE: 42501 (Error) CANNOT_COERCE: 42846 (Error)GROUPING_ERROR: 42803 (Error)WINDOWING_ERROR: 42P20 (Error)INVALID_RECURSION: 42P19 (Error)INVALID_FOREIGN_KEY: 42830 (Error) INVALID_NAME: 42602 (Error) NAME_TOO_LONG: 42622 (Error) RESERVED_NAME: 42939 (Error)DATATYPE_MISMATCH: 42804 (Error)INDETERMINATE_DATATYPE: 42P18 (Error)COLLATION_MISMATCH: 42P21 (Error)INDETERMINATE_COLLATION: 42P22 (Error)WRONG_OBJECT_TYPE: 42809 (Error)UNDEFINED_COLUMN: 42703 (Error)UNDEFINED_CURSOR: 34000 (Error)UNDEFINED_DATABASE: 3D000 (Error)UNDEFINED_FUNCTION: 42883 (Error)UNDEFINED_PSTATEMENT: 26000 (Error)UNDEFINED_SCHEMA: 3F000 (Error)UNDEFINED_TABLE: 42P01 (Error)UNDEFINED_PARAMETER: 42P02 (Error)UNDEFINED_OBJECT: 42704 (Error)DUPLICATE_COLUMN: 42701 (Error)DUPLICATE_CURSOR: 42P03 (Error)DUPLICATE_DATABASE: 42P04 (Error)DUPLICATE_FUNCTION: 42723 (Error)DUPLICATE_PSTATEMENT: 42P05 (Error)DUPLICATE_SCHEMA: 42P06 (Error)DUPLICATE_TABLE: 42P07 (Error)DUPLICATE_ALIAS: 42712 (Error)DUPLICATE_OBJECT: 42710 (Error)AMBIGUOUS_COLUMN: 42702 (Error)AMBIGUOUS_FUNCTION: 42725 (Error)AMBIGUOUS_PARAMETER: 42P08 (Error)AMBIGUOUS_ALIAS: 42P09 (Error)INVALID_COLUMN_REFERENCE: 42P10 (Error)INVALID_COLUMN_DEFINITION: 42611 (Error)INVALID_CURSOR_DEFINITION: 42P11 (Error)INVALID_DATABASE_DEFINITION: 42P12 (Error)INVALID_FUNCTION_DEFINITION: 42P13 (Error)INVALID_PSTATEMENT_DEFINITION: 42P14 (Error)INVALID_SCHEMA_DEFINITION: 42P15 (Error)INVALID_TABLE_DEFINITION: 42P16 (Error)INVALID_OBJECT_DEFINITION: 42P17 (Error)WITH_CHECK_OPTION_VIOLATION: 44000 (Error)INSUFFICIENT_RESOURCES: 53000 (Error) DISK_FULL: 53100 (Error) OUT_OF_MEMORY: 53200 (Error)TOO_MANY_CONNECTIONS: 53300 (Error)CONFIGURATION_LIMIT_EXCEEDED: 53400 (Error)PROGRAM_LIMIT_EXCEEDED: 54000 (Error)STATEMENT_TOO_COMPLEX: 54001 (Error)TOO_MANY_COLUMNS: 54011 (Error)TOO_MANY_ARGUMENTS: 54023 (Error) OBJECT_NOT_IN_PREREQUISITE_STATE: 55000 (Error) OBJECT_IN_USE: 55006 (Error)CANT_CHANGE_RUNTIME_PARAM: 55P02 (Error)LOCK_NOT_AVAILABLE: 55P03 (Error)OPERATOR_INTERVENTION: 57000 (Error)QUERY_CANCELED: 57014 (Error)ADMIN_SHUTDOWN: 57P01 (Error)CRASH_SHUTDOWN: 57P02 (Error)CANNOT_CONNECT_NOW: 57P03 (Error)DATABASE_DROPPED: 57P04 (Error) SYSTEM_ERROR: 58000 (Error)IO_ERROR: 58030 (Error)UNDEFINED_FILE: 58P01 (Error)DUPLICATE_FILE: 58P02 (Error)CONFIG_FILE_ERROR: F0000 (Error)LOCK_FILE_EXISTS: F0001 (Error) FDW_ERROR: HV000 (Error)FDW_COLUMN_NAME_NOT_FOUND: HV005 (Error)"FDW_DYNAMIC_PARAMETER_VALUE_NEEDED: HV002 (Error)FDW_FUNCTION_SEQUENCE_ERROR: HV010 (Error)'FDW_INCONSISTENT_DESCRIPTOR_INFORMATION: HV021 (Error)FDW_INVALID_ATTRIBUTE_VALUE: HV024 (Error)FDW_INVALID_COLUMN_NAME: HV007 (Error)FDW_INVALID_COLUMN_NUMBER: HV008 (Error)FDW_INVALID_DATA_TYPE: HV004 (Error)!FDW_INVALID_DATA_TYPE_DESCRIPTORS: HV006 (Error)'FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER: HV091 (Error)FDW_INVALID_HANDLE: HV00B (Error)FDW_INVALID_OPTION_INDEX: HV00C (Error)FDW_INVALID_OPTION_NAME: HV00D (Error)*FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH: HV090 (Error)FDW_INVALID_STRING_FORMAT: HV00A (Error)FDW_INVALID_USE_OF_NULL_POINTER: HV009 (Error)FDW_TOO_MANY_HANDLES: HV014 (Error)FDW_OUT_OF_MEMORY: HV001 (Error)FDW_NO_SCHEMAS: HV00P (Error)FDW_OPTION_NAME_NOT_FOUND: HV00J (Error)FDW_REPLY_HANDLE: HV00K (Error)FDW_SCHEMA_NOT_FOUND: HV00Q (Error)FDW_TABLE_NOT_FOUND: HV00R (Error)FDW_UNABLE_TO_CREATE_EXECUTION: HV00L (Error)FDW_UNABLE_TO_CREATE_REPLY: HV00M (Error)"FDW_UNABLE_TO_ESTABLISH_CONNECTION: HV00N (Error) PLPGSQL_ERROR: P0000 (Error)RAISE_EXCEPTION: P0001 (Error) NO_DATA_FOUND: P0002 (Error) TOO_MANY_ROWS: P0003 (Error)ASSERT_FAILURE: P0004 (Error)INTERNAL_ERROR: XX000 (Error)DATA_CORRUPTED: XX001 (Error)INDEX_CORRUPTED: XX002 (Error)#All known error code names by code.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~2015 Dylan SimonNone,69:;<=DRT ~Represents canonical/default PostgreSQL representation for various Haskell types, allowing convenient type-driven marshalling.:The PostgreSOL type that this type should be converted to.Encode a value using  .CProduce a literal value for interpolation in a SQL statement using   . Using + is usually safer as it includes type cast.Decode a value using ..Produce a raw SQL literal from a value. Using 8 is usually safer when interpolating in a SQL statement.VProduce a safely type-cast literal value for interpolation in a SQL statement, e.g., "'123' ::integer". Identical to N .  but more efficient.ACreate an expression that literally substitutes each instance of ${expr} for the result of pgSafeLiteral expr, producing a lazy O. This lets you do safe, type-driven literal substitution into SQL fragments without needing a full query, bypassing placeholder inference and any prepared queries, for example when using  or Q. Unlike most other TH functions, this does not require any database connection.#    "   None,0M1 +PGException is thrown upon encountering an PN with severity of ERROR, FATAL, or PANIC. It holds the message of the error.QSPGBackendMessage represents a PostgreSQL protocol message that we'll receive. See  Phttp://www.postgresql.org/docs/current/interactive/protocol-message-formats.html.R.Each DataRow (result of a query) is a list of <, which are assumed to be text unless known to be otherwise.P(An ErrorResponse contains the severity, SQLSTATE#, and message of an error. See  Mhttp://www.postgresql.org/docs/current/interactive/protocol-error-fields.html.SA ParameterDescription describes the type of a given SQL query/statement parameter ($1, $2, etc.). Unfortunately, PostgreSQL does not give us nullability information for the parameter.TA RowDescription contains the name, type, table OID, and column number of the resulting columns(s) of a query. The column number is useful for inferring nullability.UQPGFrontendMessage represents a PostgreSQL protocol message that we'll send. See  Phttp://www.postgresql.org/docs/current/interactive/protocol-message-formats.html.VWDescribe a SQL query/statement. The SQL string can contain parameters ($1, $2, etc.).W*Parse SQL Destination (prepared statement)XRSimpleQuery takes a simple SQL string. Parameters ($1, $2, etc.) aren't allowed.An established connection to the PostgreSQL server. These objects are not thread-safe and must only be used for a single request at a time.>Information for how to connect to a database, to be passed to *.The hostname (ignored if  is Y)The port, likely either PortNumber 5432 or UnixSocket "/tmp/.s.PGSQL.5432"The name of the database"3Extra parameters to set for the connection (e.g., (TimeZone, UTC))#!Log all low-level server messages$)How to log server notice messages (e.g., print . PGError)Z8Produce a human-readable string representing the message%Message SQLState code. See  Dhttp://www.postgresql.org/docs/current/static/errcodes-appendix.html.&BA database connection with sane defaults: localhost:5432:postgres'-The database information for this connection.()The type environment for this connection.)DRetrieve the "server_version" parameter from the connection, if any.[=Given a message, determin the (optional) type ID and the body\)Send a message to PostgreSQL (low-level).]Parse an incoming message.^iReceive the next message from PostgreSQL (low-level). Note that this will block until it gets a message.*Connect to a PostgreSQL server.+.Disconnect cleanly from the PostgreSQL server.,PDisconnect cleanly from the PostgreSQL server, but only if it's still connected.-Possibly re-open a connection to a different database, either reusing the connection if the given database is already connected or closing it and opening a new one. Regardless, the input connection must not be used afterwards.. Describe a SQL statement/query. A statement description consists of 0 or more parameter descriptions (a PostgreSQL type) and zero or more result field descriptions (for queries) (consist of the name of the field, the type of the field, and a nullability indicator)./;A simple query is one which requires sending only a single X message to the PostgreSQL server. The query is sent as a single string; you cannot bind parameters. Note that queries can return 0 results (an empty list).0A simple query which may contain multiple queries (separated by semi-colons) whose results are all ignored. This function can also be used for "SET" parameter queries if necessary, but it's safer better to use ".1Prepare a statement, bind it, and execute it. If the given statement has already been prepared (and not yet closed) on this connection, it will be re-used.2Like 1| but requests results lazily in chunks of the given size. Does not use a named portal, so other requests may not intervene.31Close a previously prepared query (if necessary).4UBegin a new transaction. If there is already a transaction in progress (created with 4 or 9) instead creates a savepoint.5Rollback to the most recent 4.6Commit the most recent 4.7Rollback all active 4s.8Commit all active 4s.9Wrap a computation in a 4, 6 block, or 5 on exception.:Prepare, bind, execute, and close a single (unnamed) query, and return the number of rows affected, or Nothing if there are (ignored) result rows.;-Prepare a single query and return its handle.<"Close a previously prepared query.=BBind a prepared statement, and return the row description. After =, you must either call > until it completes (returns (_, _ _)) or pgFinish before calling =& again on the same prepared statement.>Fetch a single row from an executed prepared statement, returning the next N result rows (if any) and number of affected rows when complete.  Q`abcdefRgPhiSjklmTnUopqrsVtuvWwXxyz{|}~ !"#$Z%&'()[\]^*+a handle from *,a handle from *-. SQL stringOptional type specifications1Guess nullability, otherwise assume everything is_a list of parameter types, and a list of result field names, types, and nullability indicators./ SQL string5The number of rows affected and a list of result rows0 SQL string1SQL statement with placeholders7Optional type specifications (only used for first call)"Paremeters to bind to placeholders*Requested binary format for result columns2*Chunk size (1 is common, 0 is all-at-once)3456789:;<=>.Maximum number of rows to return, or 0 for all?@A3   !"#$%&'()*+,-./0123456789:;<=>3 !"#$&  %'()*+-./0123465879,:;<=>@  Q`abcdefRgPhiSjklmTnnUopqrsVtuvWwXxyz{|}{z{zz~{   !"#$Z%&'()[\]^*+,-./0123456789:;<=>?@ANoneA + along with cached information about types.Map keyed on fromIntegral OID. Create a .6Flush the cached type list, forcing it to be reloaded.%Get a map of types from the database.Get a cached map of types.GLookup a type name by OID. This is an efficient, often pure operation.fLookup a type OID by type name. This is less common and thus less efficient than going the other way. 2016 Dylan SimonNone !",9;<=I A wrapped . This differs from a bare  in a few ways: 3It always has exactly one active transaction (with 4)"It automatically disconnects on GC*It provides a mutex around the underlying  for thread-safetyJ)Number of rows to fetch (and cache) with  and each time  requires more rows. A higher value will result in fewer round-trips to the database but potentially more wasted data. Defaults to 1. 0 means fetch all rows.KUse the underlying d directly. You must be careful to ensure that the first invariant is preserved: you should not call 4, 6, or 5, on it. All other operations should be safe.LConvert an existing  to an HDBC-compatible I. The caveats under 2 apply if you plan to continue using the original .M2Connect to a database for HDBC use (equivalent to * and 4).NtReload the table of all types from the database. This may be needed if you make structural changes to the database.O Change the J for new s created with /. Ideally this could be set with each call to  and 4, but the HDBC interface provides no way to do this.'IJKLMNOPIJKLMNOIJMLKNJOIJKLMNOP 2015 Dylan SimonNone,:MT W Generate a & based on the environment variables: TPG_HOST (localhost); TPG_SOCK or TPG_PORT (5432); TPG_DB or user; TPG_USER or USER (postgres); TPG_PASS ()X/Run an action using the Template Haskell state.Y?Run an action using the Template Haskell PostgreSQL connection.ZSpecify an alternative database to use during compilation. This lets you override the default connection parameters that are based on TPG environment variables. This should be called as a top-level declaration and produces no code. It uses -: so is safe to call multiple times with the same database.[Force reloading of all types from the database. This may be needed if you make structural changes to the database during compile-time./Lookup a type name by OID. Error if not found.zLookup a type OID by type name. This is less common and thus less efficient than going the other way. Fail if not found.\A type-aware wrapper to .]TH expression to encode a   value to a  .^TH expression to decode a   to a ()  value._TH expression calling .QRSTUVWXYZ[\]^_QRSTUVWXYZ[\]^_WXYZ[QRSTUV\]^_QRSTUVWXYZ[\]^_ 2015 Dylan SimonNone ,9;<=`AA type based on a PostgreSQL enum. Automatically instantiated by d.aThe database name of a value.b0Lookup a value matching the given database name.cCList of all the values in the enum along with their database names.dbCreate a new enum type corresponding to the given PostgreSQL enum type. For example, if you have &CREATE TYPE foo AS ENUM ('abc', 'DEF'), then !dataPGEnum "Foo" "foo" ("Foo_"++) will be equivalent to: >data Foo = Foo_abc | Foo_DEF deriving (Eq, Ord, Enum, Bounded, Typeable) instance PGType "foo" where PGVal "foo" = Foo instance PGParameter "foo" Foo where ... instance PGColumn "foo" Foo where ... instance PGRep Foo where PGRepType = "foo" instance PGEnum Foo where pgEnumValues = [(Foo_abc, "abc"), (Foo_DEF, "DEF")]Requires language extensions: TemplateHaskell, FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable, DataKinds, TypeFamilies`abcdHaskell type to createPostgreSQL enum type name9How to generate constructor names from enum values, e.g.  ("Type_"++) (input is ")`acbd`abcd`abcd None%&,9:;<=?Me9Flags affecting how and what type of query to build with u.g&Create a query -- otherwise just call # to create a string (SQL fragment).hCDisable nullability inference, treating all values as nullable (if  ) or not (if ).icPrepare and re-use query, binding parameters of the given types (inferring the rest, like PREPARE).jA prepared query that automatically is prepared in the database the first time it is run and bound with new parameters each subsequent time.kgA simple one-shot query that simply substitutes literal representations of parameters for placeholders.mbExecute a query and return the number of rows affected (or -1 if not known) and a list of results.nChange the raw SQL query stored within this query. This is unsafe because the query has already been type-checked, so any change must not change the number or type of results or placeholders (so adding additional static WHERE or ORDER BY clauses is generally safe). This is useful in cases where you need to construct some part of the query dynamically, but still want to infer the result types. If you want to add dynamic values to the query, it's best to use . For example: T[pgSQL|SELECT a FROM t|] `unsafeModifyQuery` (<> (" WHERE a = " <> pgSafeLiteral x))ogExecute a query that does not return results. Return the number of rows affected (or -1 if not known).p-Run a query and return a list of row results.qHMake a simple query directly from a query string, with no type inferencer^Make a prepared query directly from a query string and bind parameters, with no type inferencesRun a prepared query in lazy mode, where only chunk size rows are requested at a time. If you eventually retrieve all the rows this way, it will be far less efficient than using pgQuery, since every chunk requires an additional round-trip. Although you may safely stop consuming rows early, currently you may not interleave any other database operation while reading rows. (This limitation could theoretically be lifted if required.)4Given a SQL statement with placeholders of the form ${expr}0, return a (hopefully) valid SQL statement with $N placeholders and the list of expressions. This does its best to understand SQL syntax, so placeholders are only interpreted in places postgres would understand them (i.e., not in quoted strings). Since this is not valid SQL otherwise, there is never reason to escape a literal ${. You can use $NW placeholders in the query otherwise to refer to the N-th index placeholder expression.4Given a SQL statement with placeholders of the form $N and a list of TH  ByteString expressions, return a new  ByteStringB expression that substitutes the expressions for the placeholders.te for a default (simple) query.u Construct a lB from a SQL string. This is the underlying template function for ww which you can use in largely the same way when you want to construct query strings from other variables. For example: aselectQuery = "SELECT * FROM" selectFoo = $(makePGQuery simpleQueryFlags (selectQuery ++ " foo"))4The only caveat is that variables or functions like  selectQueryI need to be defined in a different module (due to TH stage restrictions).v^Parse flags off the beginning of a query string, returning the flags and the remaining string.w!A quasi-quoter for PGSQL queries.=Used in expression context, it may contain any SQL statement [pgSQL|SELECT ...|]<. The statement may contain PostgreSQL-style placeholders ($1, $2 , ...) or in-line placeholders (${1+1}2) containing any valid Haskell expression (except {}). It will be replaced by a lJ object that can be used to perform the SQL statement. If there are more $Nr placeholders than expressions, it will instead be a function accepting the additional parameters and returning a l.Ideally, this mimics postgres' SQL parsing, so that placeholders and expressions will only be expanded when they are in valid positions (i.e., not inside quoted strings). Since ${B is not valid SQL otherwise, there should be no need to escape it.TThe statement may start with one of more special flags affecting the interpretation: ?YTo disable nullability inference, treating all result values as nullable, thus returning Y values regardless of inferred nullability. This makes unexpected NULL errors impossible.!@To disable nullability inference, treating all result values as not nullable, thus only returning C where requested. This is makes unexpected NULL errors more likely.$ To create a j8 (using placeholder parameters) rather than the default k (using literal substitution). $(type,...)4To specify specific types for a prepared query (see  >http://www.postgresql.org/docs/current/static/sql-prepare.html@ for details), rather than inferring parameter types by default.#Only do literal ${} substitution using " and return a string, not a query.w can also be used at the top-level to execute SQL statements at compile-time (without any parameters and ignoring results). Here the query can only be prefixed with ! to make errors non-fatal.wIf you want to construct queries out of string variables rather than quasi-quoted strings, you can use the lower-level u instead.,efghijklmnopqrs-Chunk size (1 is common, 0 is all-or-nothing)tuvwxyz{|}~efghijklmnopqrstuvwlmnkjqrefghitvuwops#efghijklmnopqrstuvwxyz{|}~ None Convert a <-style string with placeholders into a new style SQL string. GqueryTuples :: String -> (PGConnection -> IO [(column1, column2, ...)])EQuery a PostgreSQL server and return the results as a list of tuples.Example (where h is a handle from ): ^$(queryTuples "SELECT usesysid, usename FROM pg_user") h :: IO [(Maybe String, Maybe Integer)] LqueryTuple :: String -> (PGConnection -> IO (Maybe (column1, column2, ...)))Convenience function to query a PostgreSQL server and return the first result as a tuple. If the query produces no results, return .Example (where h is a handle from ): let sysid = 10::Integer; $(queryTuple "SELECT usesysid, usename FROM pg_user WHERE usesysid = {sysid}") h :: IO (Maybe (Maybe String, Maybe Integer)) ,execute :: String -> (PGConnection -> IO ())EConvenience function to execute a statement on the PostgreSQL server.Example (where h is a handle from ):Run a sequence of IO actions (presumably SQL statements) wrapped in a transaction. Unfortunately you're restricted to using this in the " Monad for now due to the use of  onException. I'm debating adding a  MonadPeelIO version.Roll back a transaction.9Ignore duplicate key errors. This is also limited to the  Monad. the host to connect tothe port to connect onthe database to connect tothe username to connect asthe password to connect with5a handle to communicate with the PostgreSQL server on + +  2016 Dylan SimonNone:L]Data types that are based on database relations. Normally these instances are created using .:Database name of table/relation (i.e., second argument to !). Normally this is the same as pgTypeID . 8, but this preserves any specified schema qualification.Database names of columns.aCreate a new data type corresponding to the given PostgreSQL relation. For example, if you have 1CREATE TABLE foo (abc integer NOT NULL, def text), then %dataPGRelation "Foo" "foo" ("foo_"++) will be equivalent to: data Foo = Foo{ foo_abc :: PGVal "integer", foo_def :: Maybe (PGVal "text") } instance PGType "foo" where PGVal "foo" = Foo instance PGParameter "foo" Foo where ... instance PGColumn "foo" Foo where ... instance PGColumn "foo" (Maybe Foo) where ... -- to handle NULL in not null columns instance PGRep Foo where PGRepType = "foo" instance PGRecordType "foo" instance PGRelation Foo where pgColumnNames _ = ["abc", "def"] uncurryFoo :: (PGVal "integer", Maybe (PGVal "text")) -> Foo (Note that PGVal "integer" = Int32 and PGVal "text" = Textm by default.) This provides instances for marshalling the corresponding composite/record types, e.g., using SELECT foo.*::foo FROM fooc. If you want any derived instances, you'll need to create them yourself using StandaloneDeriving.Requires language extensions: TemplateHaskell, FlexibleInstances, MultiParamTypeClasses, DataKinds, TypeFamilies, PatternGuards&Haskell type and constructor to createPostgreSQL table/relation name4How to generate field names from column names, e.g.  ("table_"++) (input is ")2015 Dylan SimonNone,9:;<=DRYClass indicating that the first PostgreSQL type is an array of the second. This implies   and V instances that will work for any type using comma as a delimiter (i.e., anything but box2). This will only work with 1-dimensional arrays.0The character used as a delimeter. The default ,+ is correct for all standard types (except box).The cannonical representation of a PostgreSQL array of any type, which may always contain NULLs. Currenly only one-dimetional arrays are supported, although in PostgreSQL, any array may be of any dimentionality.rAllow entirely non-null arrays as parameter inputs only. (Only supported on ghc >= 7.10 due to instance overlap.)               None   !"#$&*+9Zopw   !"#$&*+Zwpo9 !"#$%&'()*++,--./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !!"#$%&'()*++,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] ^ ^ _ ` a b c d e f g h i j k l m n o p q q r s t u v w x y z { | } ~                        9      |} !"#$%&'()*+,-./012345.67.894:;4<=>?32@ABCDEFGHIJ.KLMNOPQRSTUVWXYZ[\.]^4_`4abcdefghijklmnopqr.stuvwxyz{|}~)*V  .s  1212       j j        .s12   -postgresql-typed-0.5.2-G432zTDvcCUJbgVuiJWrsrDatabase.PostgreSQL.Typed.Types"Database.PostgreSQL.Typed.SQLTokenDatabase.PostgreSQL.Typed.RangeDatabase.PostgreSQL.Typed.Inet"Database.PostgreSQL.Typed.ErrCodes!Database.PostgreSQL.Typed.Dynamic"Database.PostgreSQL.Typed.ProtocolDatabase.PostgreSQL.Typed.HDBCDatabase.PostgreSQL.Typed.THDatabase.PostgreSQL.Typed.EnumDatabase.PostgreSQL.Typed.Query$Database.PostgreSQL.Typed.TemplatePG"Database.PostgreSQL.Typed.RelationDatabase.PostgreSQL.Typed.ArrayPaths_postgresql_typedPGRep Data.Word byteSwap32 pgSimpleQuerypgSimpleQueries_#Database.PostgreSQL.Typed.TypeCacheL ByteStringDatabase.PostgreSQL.Typed PGRecordTypePGRecord PGStringTypeOIDPGColumnpgDecodepgDecodeBinary pgDecodeValue PGParameterpgEncode pgLiteral pgEncodeValuePGTypePGVal pgTypeNamepgBinaryColumnPGTypeID PGTypeProxyPGName pgNameBytes PGTypeEnvpgIntegerDatetimesPGValuesPGValue PGNullValue PGTextValue PGBinaryValue pgTextValue pgBinaryValueunknownPGTypeEnvpgNameBS pgNameStringpgEncodeParameterpgEscapeParameterpgDecodeColumnpgDecodeColumnNotNullpgQuote buildPGValuepgDQuote parsePGDQuote$fPGColumn"jsonb"Value$fPGParameter"jsonb"Value$fPGType"jsonb"$fPGColumn"json"Value$fPGParameter"json"Value$fPGType"json"$fPGRecordType"record"$fPGType"record"$fPGColumntPGRecord$fPGParametertPGRecord$fPGColumn"uuid"UUID$fPGParameter"uuid"UUID$fPGType"uuid"$fPGColumn"numeric"Scientific $fPGParameter"numeric"Scientific$fPGColumn"numeric"Ratio$fPGParameter"numeric"Ratio$fPGType"numeric"$fPGColumn"interval"DiffTime$fPGParameter"interval"DiffTime$fPGType"interval"+$fPGColumn"timestamp with time zone"UTCTime.$fPGParameter"timestamp with time zone"UTCTime"$fPGType"timestamp with time zone"0$fPGColumn"timestamp without time zone"LocalTime3$fPGParameter"timestamp without time zone"LocalTime%$fPGType"timestamp without time zone""$fPGColumn"time with time zone"(,)%$fPGParameter"time with time zone"(,)$fPGType"time with time zone"+$fPGColumn"time without time zone"TimeOfDay.$fPGParameter"time without time zone"TimeOfDay $fPGType"time without time zone"$fPGColumn"date"Day$fPGParameter"date"Day$fPGType"date"$fPGColumn"bytea"ByteString$fPGParameter"bytea"ByteString$fPGColumn"bytea"ByteString0$fPGParameter"bytea"ByteString0$fPGType"bytea"$fPGStringType"bpchar"$fPGStringType"name"!$fPGStringType"character varying"$fPGStringType"text"$fPGType"bpchar"$fPGType"name"$fPGType"character varying"$fPGType"text"$fPGColumntText$fPGParametertText$fPGColumntText0$fPGParametertText0$fPGColumntByteString$fPGParametertByteString$fPGColumntPGName$fPGParametertPGName$fPGColumntByteString0$fPGParametertByteString0 $fPGColumnt[]$fPGParametert[]$fPGColumn"\"char\""Char$fPGParameter"\"char\""Char$fPGColumn"\"char\""Word8$fPGParameter"\"char\""Word8$fPGType"\"char\"""$fPGColumn"double precision"Double$$fPGParameter"double precision"Float%$fPGParameter"double precision"Double$fPGType"double precision"$fPGColumn"real"Double$fPGColumn"real"Float$fPGParameter"real"Float$fPGType"real"$fPGColumn"bigint"Int64$fPGParameter"bigint"Int64$fPGType"bigint"$fPGColumn"integer"Int32$fPGParameter"integer"Int32$fPGType"integer"$fPGColumn"smallint"Int16$fPGParameter"smallint"Int16$fPGType"smallint"$fPGColumn"oid"Word32$fPGParameter"oid"Word32 $fPGType"oid"$fPGColumn"boolean"Bool$fPGParameter"boolean"Bool$fPGType"boolean"$fPGColumn"void"()$fPGParameter"void"()$fPGType"void"$fPGParameter"any"PGValue$fPGColumntPGValue $fPGType"any"$fPGColumntMaybe$fPGParametertMaybe $fShowPGName$fIsStringPGName $fShowPGValue $fEqPGValue$fShowPGTypeEnv $fEqPGName $fOrdPGName $fDataPGNameSQLTokenSQLParamSQLExprSQLQMark sqlTokens$fIsStringSQLToken$fShowSQLToken $fEqSQLToken PGRangeType PGSubTypepgRangeElementTypeRangeEmptylowerupper UpperBoundUpper boundUpper LowerBoundLower boundLowerBound UnboundedBounded _boundClosed_bound compareBoundsbound boundClosed makeBound lowerBound upperBound lowerClosed upperClosedemptyisEmptyfullisFullpointgetPointrangenormalbounded normalize normalize'@><@@>.overlaps intersect$fPGRangeType"int8range"$fPGType"int8range"$fPGRangeType"daterange"$fPGType"daterange"$fPGRangeType"tstzrange"$fPGType"tstzrange"$fPGRangeType"tsrange"$fPGType"tsrange"$fPGRangeType"numrange"$fPGType"numrange"$fPGRangeType"int4range"$fPGType"int4range"$fPGColumntRange$fPGParametertRange $fMonoidRange $fShowRange$fFunctorRange$fBoundedUpperBound$fOrdUpperBound$fBoundedLowerBound$fOrdLowerBound$fFunctorBound $fEqBound$fEqLowerBound$fFunctorLowerBound$fEqUpperBound$fFunctorUpperBound $fEqRange $fOrdRangePGInetPGInet6 pgInetAddr pgInetMask pgInetAddr6sockAddrPGInetbton32$fPGColumn"cidr"PGInet$fPGColumn"inet"PGInet$fPGParameter"cidr"PGInet$fPGParameter"inet"PGInet$fPGType"cidr"$fPGType"inet" $fReadPGInet $fShowPGInet $fEqPGInetsuccessful_completionwarning$warning_dynamic_result_sets_returned!warning_implicit_zero_bit_padding-warning_null_value_eliminated_in_set_functionwarning_privilege_not_grantedwarning_privilege_not_revoked$warning_string_data_right_truncationwarning_deprecated_featureno_data*no_additional_dynamic_result_sets_returnedsql_statement_not_yet_completeconnection_exceptionconnection_does_not_existconnection_failure+sqlclient_unable_to_establish_sqlconnection1sqlserver_rejected_establishment_of_sqlconnectiontransaction_resolution_unknownprotocol_violationtriggered_action_exceptionfeature_not_supportedinvalid_transaction_initiationlocator_exceptioninvalid_locator_specificationinvalid_grantorinvalid_grant_operationinvalid_role_specificationdiagnostics_exception3stacked_diagnostics_accessed_without_active_handlercase_not_foundcardinality_violationdata_exception_ARRAY_ELEMENT_ERRORarray_subscript_errorcharacter_not_in_repertoiredatetime_field_overflow_DATETIME_VALUE_OUT_OF_RANGEdivision_by_zeroerror_in_assignmentescape_character_conflictindicator_overflowinterval_field_overflowinvalid_argument_for_logarithm#invalid_argument_for_ntile_function'invalid_argument_for_nth_value_function#invalid_argument_for_power_function*invalid_argument_for_width_bucket_function invalid_character_value_for_castinvalid_datetime_formatinvalid_escape_characterinvalid_escape_octetinvalid_escape_sequence#nonstandard_use_of_escape_character!invalid_indicator_parameter_valueinvalid_parameter_valueinvalid_regular_expression!invalid_row_count_in_limit_clause)invalid_row_count_in_result_offset_clauseinvalid_tablesample_argumentinvalid_tablesample_repeat$invalid_time_zone_displacement_valueinvalid_use_of_escape_charactermost_specific_type_mismatchnull_value_not_allowed!null_value_no_indicator_parameternumeric_value_out_of_rangestring_data_length_mismatchstring_data_right_truncationsubstring_error trim_errorunterminated_c_stringzero_length_character_stringfloating_point_exceptioninvalid_text_representationinvalid_binary_representationbad_copy_file_formatuntranslatable_characternot_an_xml_documentinvalid_xml_documentinvalid_xml_contentinvalid_xml_comment"invalid_xml_processing_instructionintegrity_constraint_violationrestrict_violationnot_null_violationforeign_key_violationunique_violationcheck_violationexclusion_violationinvalid_cursor_stateinvalid_transaction_stateactive_sql_transaction!branch_transaction_already_active)held_cursor_requires_same_isolation_level0inappropriate_access_mode_for_branch_transaction4inappropriate_isolation_level_for_branch_transaction0no_active_sql_transaction_for_branch_transactionread_only_sql_transaction.schema_and_data_statement_mixing_not_supportedno_active_sql_transactionin_failed_sql_transactioninvalid_sql_statement_nametriggered_data_change_violation#invalid_authorization_specificationinvalid_password+dependent_privilege_descriptors_still_existdependent_objects_still_existinvalid_transaction_terminationsql_routine_exception+s_r_e_function_executed_no_return_statement&s_r_e_modifying_sql_data_not_permitted(s_r_e_prohibited_sql_statement_attempted$s_r_e_reading_sql_data_not_permittedinvalid_cursor_nameexternal_routine_exception"e_r_e_containing_sql_not_permitted&e_r_e_modifying_sql_data_not_permitted(e_r_e_prohibited_sql_statement_attempted$e_r_e_reading_sql_data_not_permitted%external_routine_invocation_exception!e_r_i_e_invalid_sqlstate_returnede_r_i_e_null_value_not_allowed!e_r_i_e_trigger_protocol_violatede_r_i_e_srf_protocol_violated'e_r_i_e_event_trigger_protocol_violatedsavepoint_exceptioninvalid_savepoint_specificationinvalid_catalog_nameinvalid_schema_nametransaction_rollback*transaction_integrity_constraint_violationserialization_failurestatement_completion_unknowndeadlock_detected%syntax_error_or_access_rule_violation syntax_errorinsufficient_privilege cannot_coercegrouping_errorwindowing_errorinvalid_recursioninvalid_foreign_key invalid_name name_too_long reserved_namedatatype_mismatchindeterminate_datatypecollation_mismatchindeterminate_collationwrong_object_typeundefined_column_UNDEFINED_CURSOR_UNDEFINED_DATABASEundefined_function_UNDEFINED_PSTATEMENT_UNDEFINED_SCHEMAundefined_tableundefined_parameterundefined_objectduplicate_columnduplicate_cursorduplicate_databaseduplicate_functionduplicate_prepared_statementduplicate_schemaduplicate_tableduplicate_aliasduplicate_objectambiguous_columnambiguous_functionambiguous_parameterambiguous_aliasinvalid_column_referenceinvalid_column_definitioninvalid_cursor_definitioninvalid_database_definitioninvalid_function_definition%invalid_prepared_statement_definitioninvalid_schema_definitioninvalid_table_definitioninvalid_object_definitionwith_check_option_violationinsufficient_resources disk_full out_of_memorytoo_many_connectionsconfiguration_limit_exceededprogram_limit_exceededstatement_too_complextoo_many_columnstoo_many_arguments object_not_in_prerequisite_state object_in_usecant_change_runtime_paramlock_not_availableoperator_interventionquery_canceledadmin_shutdowncrash_shutdowncannot_connect_nowdatabase_dropped system_errorio_errorundefined_fileduplicate_fileconfig_file_errorlock_file_exists fdw_errorfdw_column_name_not_found"fdw_dynamic_parameter_value_neededfdw_function_sequence_error'fdw_inconsistent_descriptor_informationfdw_invalid_attribute_valuefdw_invalid_column_namefdw_invalid_column_numberfdw_invalid_data_type!fdw_invalid_data_type_descriptors'fdw_invalid_descriptor_field_identifierfdw_invalid_handlefdw_invalid_option_indexfdw_invalid_option_name*fdw_invalid_string_length_or_buffer_lengthfdw_invalid_string_formatfdw_invalid_use_of_null_pointerfdw_too_many_handlesfdw_out_of_memoryfdw_no_schemasfdw_option_name_not_foundfdw_reply_handlefdw_schema_not_foundfdw_table_not_foundfdw_unable_to_create_executionfdw_unable_to_create_reply"fdw_unable_to_establish_connection plpgsql_errorraise_exception no_data_found too_many_rowsassert_failureinternal_errordata_corruptedindex_corruptednames PGRepTypepgTypeOf pgTypeOfProxy pgEncodeRep pgLiteralRep pgDecodeReppgLiteralString pgSafeLiteralpgSafeLiteralStringpgSubstituteLiterals $fPGRepValue $fPGRepUUID$fPGRepScientific $fPGRepRatio$fPGRepDiffTime$fPGRepUTCTime$fPGRepLocalTime $fPGRep(,)$fPGRepTimeOfDay $fPGRepDay $fPGRepText $fPGRepPGName$fPGRepByteString $fPGRep[] $fPGRepChar $fPGRepDouble $fPGRepFloat $fPGRepInt64 $fPGRepInt32 $fPGRepInt16 $fPGRepWord32 $fPGRepBool $fPGRep() $fPGRepMaybePGError pgErrorFieldsPGRowDescriptionPGColDescriptioncolNamecolTable colNumbercolTypecolSize colModifier colBinary PGConnectionPGPreparedStatement PGDatabasepgDBHostpgDBPortpgDBNamepgDBUserpgDBPass pgDBParams pgDBDebugpgDBLogMessage pgErrorCodedefaultPGDatabasepgConnectionDatabase pgTypeEnvpgServerVersion pgConnect pgDisconnectpgDisconnectOnce pgReconnect pgDescribepgPreparedQuerypgPreparedLazyQuerypgCloseStatementpgBegin pgRollbackpgCommit pgRollbackAll pgCommitAll pgTransactionpgRun pgPreparepgClosepgBindpgFetch$fExceptionPGError $fShowPGError$fEqPGDatabase $fShowPGState $fEqPGState$fEqPGPreparedStatement$fShowPGPreparedStatement$fShowPGColDescription$fShowPGFrontendMessage$fShowPGBackendMessage ConnectionconnectionFetchSizewithPGConnectionfromPGConnectionconnect reloadTypes setFetchSize$fIConnectionConnection TPGValueInfo tpgValueNametpgValueTypeOID tpgValueTypetpgValueNullablegetTPGDatabasewithTPGTypeConnectionwithTPGConnectionuseTPGDatabasereloadTPGTypes tpgDescribetpgTypeEncodertpgTypeDecoder tpgTypeBinaryPGEnum pgEnumName pgEnumValue pgEnumValues dataPGEnum QueryFlags flagQuery flagNullable flagPreparePGPreparedQuery PGSimpleQueryPGQuery pgRunQueryunsafeModifyQuery pgExecutepgQueryrawPGSimpleQueryrawPGPreparedQuery pgLazyQuerysimpleQueryFlags makePGQueryparseQueryFlagspgSQL$fIsStringQueryParser$fIsStringQueryParser0$fShowQueryParser$fFunctorQueryParser$fPGQueryQueryParsera$fPGRawQueryPreparedQuery$fPGQueryPreparedQuery[]$fPGRawQuerySimpleQuery$fPGQuerySimpleQuery[]$fPGQueryByteString[]$fShowSimpleQuery$fShowPreparedQuery PGException queryTuples queryTupleexecutewithTransactionrollback insertIgnoredataPGRelation PGArrayType PGElemTypepgArrayElementType pgArrayDelimPGArray$fPGArrayType"int8range[]"$fPGType"int8range[]"$fPGArrayType"daterange[]"$fPGType"daterange[]"$fPGArrayType"tstzrange[]"$fPGType"tstzrange[]"$fPGArrayType"tsrange[]"$fPGType"tsrange[]"$fPGArrayType"numrange[]"$fPGType"numrange[]"$fPGArrayType"int4range[]"$fPGType"int4range[]"$fPGArrayType"regdictionary[]"$fPGType"regdictionary[]"$fPGArrayType"regconfig[]"$fPGType"regconfig[]"$fPGArrayType"gtsvector[]"$fPGType"gtsvector[]"$fPGArrayType"tsquery[]"$fPGType"tsquery[]"$fPGArrayType"tsvector[]"$fPGType"tsvector[]"$fPGArrayType"txid_snapshot[]"$fPGType"txid_snapshot[]"$fPGArrayType"uuid[]"$fPGType"uuid[]"$fPGArrayType"cstring[]"$fPGType"cstring[]"$fPGArrayType"record[]"$fPGType"record[]"$fPGArrayType"regtype[]"$fPGType"regtype[]"$fPGArrayType"regclass[]"$fPGType"regclass[]"$fPGArrayType"regoperator[]"$fPGType"regoperator[]"$fPGArrayType"regoper[]"$fPGType"regoper[]"$fPGArrayType"regprocedure[]"$fPGType"regprocedure[]"$fPGArrayType"refcursor[]"$fPGType"refcursor[]"$fPGArrayType"numeric[]"$fPGType"numeric[]"$fPGArrayType"varbit[]"$fPGType"varbit[]"$fPGArrayType"bit[]"$fPGType"bit[]"$$fPGArrayType"time with time zone[]"$fPGType"time with time zone[]"$fPGArrayType"interval[]"$fPGType"interval[]")$fPGArrayType"timestamp with time zone[]"$$fPGType"timestamp with time zone[]",$fPGArrayType"timestamp without time zone[]"'$fPGType"timestamp without time zone[]"'$fPGArrayType"time without time zone[]""$fPGType"time without time zone[]"$fPGArrayType"date[]"$fPGType"date[]""$fPGArrayType"character varying[]"$fPGType"character varying[]"$fPGArrayType"bpchar[]"$fPGType"bpchar[]"$fPGArrayType"aclitem[]"$fPGType"aclitem[]"$fPGArrayType"inet[]"$fPGType"inet[]"$fPGArrayType"macaddr[]"$fPGType"macaddr[]"$fPGArrayType"money[]"$fPGType"money[]"$fPGArrayType"circle[]"$fPGType"circle[]"$fPGArrayType"tinterval[]"$fPGType"tinterval[]"$fPGArrayType"reltime[]"$fPGType"reltime[]"$fPGArrayType"abstime[]"$fPGType"abstime[]"!$fPGArrayType"double precision[]"$fPGType"double precision[]"$fPGArrayType"real[]"$fPGType"real[]"$fPGArrayType"cidr[]"$fPGType"cidr[]"$fPGArrayType"line[]"$fPGType"line[]"$fPGArrayType"polygon[]"$fPGType"polygon[]"$fPGArrayType"box[]"$fPGType"box[]"$fPGArrayType"path[]"$fPGType"path[]"$fPGArrayType"lseg[]"$fPGType"lseg[]"$fPGArrayType"point[]"$fPGType"point[]"$fPGArrayType"xml[]"$fPGType"xml[]"$fPGArrayType"json[]"$fPGType"json[]"$fPGArrayType"oidvector[]"$fPGType"oidvector[]"$fPGArrayType"cid[]"$fPGType"cid[]"$fPGArrayType"xid[]"$fPGType"xid[]"$fPGArrayType"tid[]"$fPGType"tid[]"$fPGArrayType"oid[]"$fPGType"oid[]"$fPGArrayType"text[]"$fPGType"text[]"$fPGArrayType"regproc[]"$fPGType"regproc[]"$fPGArrayType"integer[]"$fPGType"integer[]"$fPGArrayType"int2vector[]"$fPGType"int2vector[]"$fPGArrayType"smallint[]"$fPGType"smallint[]"$fPGArrayType"bigint[]"$fPGType"bigint[]"$fPGArrayType"name[]"$fPGType"name[]"$fPGArrayType"\"char\"[]"$fPGType"\"char\"[]"$fPGArrayType"bytea[]"$fPGType"bytea[]"$fPGArrayType"boolean[]"$fPGType"boolean[]"$fPGParametert[]0catchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamebase GHC.TypeLits symbolValghc-prim GHC.TypesSymbolbytestring-0.10.8.1Data.ByteString.Internal Data.DataData Data.StringIsStringData.ByteString.LazytoStrictData.ByteString.BuildertoLazyByteString BinEncoder BinDecoder pgQuoteUnsafebinEncbinDec encodeBytea decodeByteareadTimebinColDatetimebinEncDatetimebinDecDatetimefixTZ showRationalGHC.ShowshowListPH++:+:xxthrucommentxexqxd identStart dolqStartdolqCont identContxdolqxcexprGHC.EnumEnumData.ByteString.Char8unpackData.ByteString.Lazy.Internal ErrorResponsePGBackendMessageDataRowParameterDescriptionRowDescriptionPGFrontendMessageDescribeStatementParse SimpleQuery&network-2.6.3.2-IsLM4TXcLoRI0fmmBYVyQzNetwork UnixSocketdisplayMessage messageBodypgSendgetMessageBody pgReceiveGHC.BaseJustAuthenticationOkAuthenticationCleartextPasswordAuthenticationMD5PasswordBackendKeyData BindComplete CloseCompleteCommandCompleteEmptyQueryResponseNoDataNoticeResponseParameterStatus ParseCompletePortalSuspended ReadyForQuery messageFieldsStartupMessage CancelRequestBindCloseStatement ClosePortalDescribePortalExecuteFlushPasswordMessageSync Terminate portalName statementNamebindParameters binaryColumns executeRows queryString parseTypes MessageFields connHandle connDatabaseconnPidconnKeyconnParameters connTypeEnvconnPreparedStatementCountconnPreparedStatementMap connState connInputconnTransactionPGState StateUnsync StatePending StateIdleStateTransactionStateTransactionFailed StateClosedpreparedStatementName makeMessagedefaultLogMessage connDebugconnLogMessagemd5nul byteStringNullazyByteStringNulpgFlushgetByteStringNulgetMessageFields getMessagepgRecvpgSyncrowDescription rowsAffected fixBinarypgPreparedBindpredTransactionPGTypeConnectionPGTypesnewPGTypeConnectionflushPGTypeConnection pgGetTypes getPGTypes lookupPGType findPGType pgConnectionpgTypes#HDBC-2.4.0.2-1zqEg4HcqMV1kQtguZUFwODatabase.HDBC.StatementfetchRow connectionPG StatementDatabase.HDBC.TypesprepareSqlType sqlTypeId sqlTypeDecodeCursor cursorDesc cursorRow cursorActive_cursorStatementColDesc colDescNamecolDesc colDescDecodeconnectionServerVerconnectionTypessqlErrortakePGConnectionsqls placeholdersnoCursorgetType encodeRepencodesqlTypetypeId decodeRepdecodetpgType getTPGTypeOIDMaybetpgState typeApplyTrueFalsesqlPlaceholders sqlSubstitute QueryParser PreparedQuery PGRawQuery rawParser splitCommastrimnewNameqqQueryqqTopquerySQLNothingIO PGRelationpgRelationName pgColumnNames