diff --git a/codegen/src/errcodes.txt b/codegen/src/errcodes.txt index 7b97d45a..be924d58 100644 --- a/codegen/src/errcodes.txt +++ b/codegen/src/errcodes.txt @@ -2,7 +2,7 @@ # errcodes.txt # PostgreSQL error codes # -# Copyright (c) 2003-2015, PostgreSQL Global Development Group +# Copyright (c) 2003-2016, PostgreSQL Global Development Group # # This list serves as the basis for generating source files containing error # codes. It is kept in a common format to make sure all these source files have @@ -15,6 +15,9 @@ # src/pl/plpgsql/src/plerrcodes.h # a list of PL/pgSQL condition names and their SQLSTATE codes # +# src/pl/tcl/pltclerrcodes.h +# the same, for PL/Tcl +# # doc/src/sgml/errcodes-list.sgml # a SGML table of error codes for inclusion in the documentation # @@ -229,6 +232,7 @@ Section: Class 25 - Invalid Transaction State 25007 E ERRCODE_SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED schema_and_data_statement_mixing_not_supported 25P01 E ERRCODE_NO_ACTIVE_SQL_TRANSACTION no_active_sql_transaction 25P02 E ERRCODE_IN_FAILED_SQL_TRANSACTION in_failed_sql_transaction +25P03 E ERRCODE_IDLE_IN_TRANSACTION_SESSION_TIMEOUT idle_in_transaction_session_timeout Section: Class 26 - Invalid SQL Statement Name @@ -413,6 +417,10 @@ Section: Class 58 - System Error (errors external to PostgreSQL itself) 58P01 E ERRCODE_UNDEFINED_FILE undefined_file 58P02 E ERRCODE_DUPLICATE_FILE duplicate_file +Section: Class 72 - Snapshot Failure +# (class borrowed from Oracle) +72000 E ERRCODE_SNAPSHOT_TOO_OLD snapshot_too_old + Section: Class F0 - Configuration File Error # (PostgreSQL-specific error class) diff --git a/codegen/src/pg_range.h b/codegen/src/pg_range.h index 9a158903..14d3b123 100644 --- a/codegen/src/pg_range.h +++ b/codegen/src/pg_range.h @@ -5,7 +5,7 @@ * along with the relation's initial contents. * * - * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_range.h diff --git a/codegen/src/pg_type.h b/codegen/src/pg_type.h index 7dc95c8d..162239c7 100644 --- a/codegen/src/pg_type.h +++ b/codegen/src/pg_type.h @@ -5,7 +5,7 @@ * along with the relation's initial contents. * * - * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_type.h @@ -694,6 +694,8 @@ DATA(insert OID = 3500 ( anyenum PGNSP PGUID 4 t p P f t \054 0 0 0 anyenum_in #define ANYENUMOID 3500 DATA(insert OID = 3115 ( fdw_handler PGNSP PGUID 4 t p P f t \054 0 0 0 fdw_handler_in fdw_handler_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define FDW_HANDLEROID 3115 +DATA(insert OID = 325 ( index_am_handler PGNSP PGUID 4 t p P f t \054 0 0 0 index_am_handler_in index_am_handler_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); +#define INDEX_AM_HANDLEROID 325 DATA(insert OID = 3310 ( tsm_handler PGNSP PGUID 4 t p P f t \054 0 0 0 tsm_handler_in tsm_handler_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define TSM_HANDLEROID 3310 DATA(insert OID = 3831 ( anyrange PGNSP PGUID -1 f p P f t \054 0 0 0 anyrange_in anyrange_out - - - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); diff --git a/src/error/sqlstate.rs b/src/error/sqlstate.rs index 4056ea9e..e7b5c292 100644 --- a/src/error/sqlstate.rs +++ b/src/error/sqlstate.rs @@ -202,6 +202,8 @@ pub enum SqlState { NoActiveSqlTransaction, /// `25P02` InFailedSqlTransaction, + /// `25P03` + IdleInTransactionSessionTimeout, /// `26000` InvalidSqlStatementName, /// `27000` @@ -402,6 +404,8 @@ pub enum SqlState { UndefinedFile, /// `58P02` DuplicateFile, + /// `72000` + SnapshotTooOld, /// `F0000` ConfigFileError, /// `F0001` @@ -484,292 +488,294 @@ pub enum SqlState { static SQLSTATE_MAP: phf::Map<&'static str, SqlState> = ::phf::Map { key: 1897749892740154578, disps: ::phf::Slice::Static(&[ - (0, 10), - (1, 206), - (0, 38), - (0, 10), - (0, 0), - (1, 2), - (0, 43), - (0, 0), - (2, 4), - (0, 153), - (0, 34), - (0, 8), - (0, 29), - (0, 42), - (0, 52), - (0, 0), - (1, 51), - (2, 198), - (9, 158), - (1, 18), - (0, 19), - (0, 65), - (1, 118), - (1, 125), - (3, 235), + (0, 5), + (1, 65), (0, 87), - (0, 21), - (3, 164), - (0, 3), - (4, 117), - (11, 120), - (0, 115), - (40, 222), - (0, 8), - (8, 124), - (1, 142), + (0, 5), (0, 0), (0, 0), - (10, 78), - (1, 173), - (10, 37), - (2, 209), - (18, 30), - (1, 19), - (0, 10), - (0, 233), - (2, 149), - (0, 105), + (2, 166), + (0, 1), + (0, 12), + (1, 143), + (0, 100), + (0, 4), + (0, 52), + (0, 102), + (0, 0), + (0, 0), + (4, 159), + (0, 180), + (1, 77), + (0, 23), + (0, 204), + (4, 34), + (0, 48), + (0, 100), + (9, 66), + (2, 93), + (0, 13), + (2, 13), + (0, 2), + (10, 24), + (8, 229), + (0, 225), + (25, 220), + (0, 13), + (40, 96), + (1, 76), + (0, 0), + (0, 0), + (0, 237), + (0, 32), + (2, 187), + (0, 81), + (36, 10), + (0, 43), + (0, 65), + (5, 108), + (7, 163), + (0, 1), ]), entries: ::phf::Slice::Static(&[ - ("42P03", SqlState::DuplicateCursor), - ("22019", SqlState::InvalidEscapeCharacter), - ("22022", SqlState::IndicatorOverflow), - ("25002", SqlState::BranchTransactionAlreadyActive), - ("2F004", SqlState::SqlRoutineReadingSqlDataNotPermitted), - ("23505", SqlState::UniqueViolation), - ("HV00J", SqlState::FdwOptionNameNotFound), - ("42P17", SqlState::InvalidObjectDefinition), - ("25000", SqlState::InvalidTransactionState), - ("08001", SqlState::SqlclientUnableToEstablishSqlconnection), - ("25008", SqlState::HeldCursorRequiresSameIsolationLevel), ("2201E", SqlState::InvalidArgumentForLogarithm), - ("2200T", SqlState::InvalidXmlProcessingInstruction), - ("2200F", SqlState::ZeroLengthCharacterString), - ("HV002", SqlState::FdwDynamicParameterValueNeeded), - ("2201B", SqlState::InvalidRegularExpression), - ("22007", SqlState::InvalidDatetimeFormat), - ("3B001", SqlState::InvalidSavepointSpecification), - ("54023", SqlState::TooManyArguments), - ("25P02", SqlState::InFailedSqlTransaction), - ("2201X", SqlState::InvalidRowCountInResultOffsetClause), - ("23P01", SqlState::ExclusionViolation), - ("42P13", SqlState::InvalidFunctionDefinition), - ("42712", SqlState::DuplicateAlias), - ("39P02", SqlState::SrfProtocolViolated), - ("23503", SqlState::ForeignKeyViolation), - ("42P16", SqlState::InvalidTableDefinition), - ("42000", SqlState::SyntaxErrorOrAccessRuleViolation), - ("23000", SqlState::IntegrityConstraintViolation), - ("53400", SqlState::ConfigurationLimitExceeded), - ("38001", SqlState::ContainingSqlNotPermitted), - ("2200D", SqlState::InvalidEscapeOctet), - ("0B000", SqlState::InvalidTransactionInitiation), - ("HV007", SqlState::FdwInvalidColumnName), + ("38000", SqlState::ExternalRoutineException), + ("20000", SqlState::CaseNotFound), ("42P15", SqlState::InvalidSchemaDefinition), - ("HV00A", SqlState::FdwInvalidStringFormat), - ("22026", SqlState::StringDataLengthMismatch), - ("22011", SqlState::SubstringError), - ("39P03", SqlState::EventTriggerProtocolViolated), - ("42P02", SqlState::UndefinedParameter), - ("XX000", SqlState::InternalError), - ("2200S", SqlState::InvalidXmlComment), - ("25007", SqlState::SchemaAndDataStatementMixingNotSupported), - ("42710", SqlState::DuplicateObject), - ("25P01", SqlState::NoActiveSqlTransaction), - ("2200N", SqlState::InvalidXmlContent), - ("01004", SqlState::WarningStringDataRightTruncation), - ("42703", SqlState::UndefinedColumn), - ("42P07", SqlState::DuplicateTable), - ("26000", SqlState::InvalidSqlStatementName), - ("01003", SqlState::NullValueEliminatedInSetFunction), - ("22001", SqlState::DataStringDataRightTruncation), - ("22012", SqlState::DivisionByZero), - ("2F005", SqlState::FunctionExecutedNoReturnStatement), - ("55P02", SqlState::CantChangeRuntimeParam), - ("39P01", SqlState::TriggerProtocolViolated), - ("3F000", SqlState::InvalidSchemaName), - ("42501", SqlState::InsufficientPrivilege), - ("22P01", SqlState::FloatingPointException), - ("22004", SqlState::DataNullValueNotAllowed), - ("HV00C", SqlState::FdwInvalidOptionIndex), - ("HV00Q", SqlState::FdwSchemaNotFound), - ("22P03", SqlState::InvalidBinaryRepresentation), - ("22002", SqlState::NullValueNoIndicatorParameter), + ("HV014", SqlState::FdwTooManyHandles), + ("09000", SqlState::TriggeredActionException), + ("2200D", SqlState::InvalidEscapeOctet), + ("22016", SqlState::InvalidArgumentForNthValueFunction), + ("0100C", SqlState::DynamicResultSetsReturned), ("01007", SqlState::PrivilegeNotGranted), - ("HV021", SqlState::FdwInconsistentDescriptorInformation), - ("42P05", SqlState::DuplicatePreparedStatement), - ("53000", SqlState::InsufficientResources), - ("HV008", SqlState::FdwInvalidColumnNumber), - ("42602", SqlState::InvalidName), - ("40001", SqlState::SerializationFailure), - ("25006", SqlState::ReadOnlySqlTransaction), - ("00000", SqlState::SuccessfulCompletion), - ("HV005", SqlState::FdwColumnNameNotFound), - ("42939", SqlState::ReservedName), ("22P04", SqlState::BadCopyFileFormat), + ("22P01", SqlState::FloatingPointException), + ("22022", SqlState::IndicatorOverflow), + ("0F000", SqlState::LocatorException), + ("28P01", SqlState::InvalidPassword), + ("38004", SqlState::ForeignRoutineReadingSqlDataNotPermitted), + ("25004", SqlState::InappropriateIsolationLevelForBranchTransaction), + ("HV00M", SqlState::FdwUnableToCreateReply), + ("2F000", SqlState::SqlRoutineException), + ("25003", SqlState::InappropriateAccessModeForBranchTransaction), + ("08P01", SqlState::ProtocolViolation), + ("P0002", SqlState::NoDataFound), + ("HV010", SqlState::FdwFunctionSequenceError), + ("2200G", SqlState::MostSpecificTypeMismatch), + ("HV007", SqlState::FdwInvalidColumnName), + ("HV00Q", SqlState::FdwSchemaNotFound), + ("22004", SqlState::DataNullValueNotAllowed), + ("42611", SqlState::InvalidColumnDefinition), + ("42846", SqlState::CannotCoerce), + ("P0000", SqlState::PlpgsqlError), + ("25005", SqlState::NoActiveSqlTransactionForBranchTransaction), + ("HV00L", SqlState::FdwUnableToCreateExecution), + ("XX002", SqlState::IndexCorrupted), + ("42P22", SqlState::IndeterminateCollation), + ("HV00C", SqlState::FdwInvalidOptionIndex), + ("38002", SqlState::ForeignRoutineModifyingSqlDataNotPermitted), + ("HV000", SqlState::FdwError), + ("08006", SqlState::ConnectionFailure), + ("25P03", SqlState::IdleInTransactionSessionTimeout), + ("42P07", SqlState::DuplicateTable), + ("HV00R", SqlState::FdwTableNotFound), + ("42P06", SqlState::DuplicateSchema), + ("3F000", SqlState::InvalidSchemaName), + ("2200B", SqlState::EscapeCharacterConflict), + ("23502", SqlState::NotNullViolation), + ("55000", SqlState::ObjectNotInPrerequisiteState), + ("P0004", SqlState::AssertFailure), + ("42712", SqlState::DuplicateAlias), + ("08003", SqlState::ConnectionDoesNotExist), + ("22027", SqlState::TrimError), + ("39P02", SqlState::SrfProtocolViolated), + ("40003", SqlState::StatementCompletionUnknown), + ("2202G", SqlState::InvalidTablesampleRepeat), + ("28000", SqlState::InvalidAuthorizationSpecification), + ("42704", SqlState::UndefinedObject), + ("25001", SqlState::ActiveSqlTransaction), + ("HV008", SqlState::FdwInvalidColumnNumber), + ("22P02", SqlState::InvalidTextRepresentation), + ("40P01", SqlState::DeadlockDetected), + ("25P02", SqlState::InFailedSqlTransaction), + ("23514", SqlState::CheckViolation), + ("HV00A", SqlState::FdwInvalidStringFormat), + ("42P11", SqlState::InvalidCursorDefinition), + ("0A000", SqlState::FeatureNotSupported), + ("26000", SqlState::InvalidSqlStatementName), + ("55P02", SqlState::CantChangeRuntimeParam), + ("53000", SqlState::InsufficientResources), + ("42P03", SqlState::DuplicateCursor), + ("42830", SqlState::InvalidForeignKey), + ("22000", SqlState::DataException), + ("08000", SqlState::ConnectionException), + ("57P01", SqlState::AdminShutdown), + ("42P05", SqlState::DuplicatePreparedStatement), + ("23001", SqlState::RestrictViolation), + ("42P09", SqlState::AmbiguousAlias), + ("01008", SqlState::ImplicitZeroBitPadding), + ("22026", SqlState::StringDataLengthMismatch), + ("39000", SqlState::ExternalRoutineInvocationException), ("22015", SqlState::IntervalFieldOverflow), + ("HV00J", SqlState::FdwOptionNameNotFound), + ("03000", SqlState::SqlStatementNotYetComplete), + ("42P21", SqlState::CollationMismatch), + ("22P03", SqlState::InvalidBinaryRepresentation), + ("P0003", SqlState::TooManyRows), + ("HV021", SqlState::FdwInconsistentDescriptorInformation), + ("42703", SqlState::UndefinedColumn), + ("2200C", SqlState::InvalidUseOfEscapeCharacter), + ("57P03", SqlState::CannotConnectNow), + ("2201F", SqlState::InvalidArgumentForPowerFunction), + ("2200N", SqlState::InvalidXmlContent), + ("42622", SqlState::NameTooLong), + ("22019", SqlState::InvalidEscapeCharacter), + ("58000", SqlState::SystemError), + ("2202E", SqlState::ArraySubscriptError), + ("HV00P", SqlState::FdwNoSchemas), + ("HV004", SqlState::FdwInvalidDataType), + ("01003", SqlState::NullValueEliminatedInSetFunction), + ("2200F", SqlState::ZeroLengthCharacterString), + ("42710", SqlState::DuplicateObject), + ("HV00B", SqlState::FdwInvalidHandle), + ("2200L", SqlState::NotAnXmlDocument), + ("2B000", SqlState::DependentPrivilegeDescriptorsStillExist), + ("XX001", SqlState::DataCorrupted), + ("HV002", SqlState::FdwDynamicParameterValueNeeded), + ("57014", SqlState::QueryCanceled), + ("22011", SqlState::SubstringError), + ("42P08", SqlState::AmbiguousParameter), + ("72000", SqlState::SnapshotTooOld), + ("23503", SqlState::ForeignKeyViolation), + ("02001", SqlState::NoAdditionalDynamicResultSetsReturned), + ("2201B", SqlState::InvalidRegularExpression), + ("39001", SqlState::InvalidSqlstateReturned), + ("42602", SqlState::InvalidName), + ("22008", SqlState::DatetimeFieldOverflow), + ("34000", SqlState::InvalidCursorName), + ("0F001", SqlState::InvalidLocatorSpecification), ("42P14", SqlState::InvalidPreparedStatementDefinition), ("01P01", SqlState::DeprecatedFeature), - ("2200G", SqlState::MostSpecificTypeMismatch), - ("HV001", SqlState::FdwOutOfMemory), - ("08004", SqlState::SqlserverRejectedEstablishmentOfSqlconnection), - ("42809", SqlState::WrongObjectType), - ("HV009", SqlState::FdwInvalidUseOfNullPointer), - ("58P02", SqlState::DuplicateFile), - ("0Z000", SqlState::DiagnosticsException), - ("08P01", SqlState::ProtocolViolation), - ("42723", SqlState::DuplicateFunction), - ("P0002", SqlState::NoDataFound), - ("22021", SqlState::CharacterNotInRepertoire), - ("01006", SqlState::PrivilegeNotRevoked), - ("0LP01", SqlState::InvalidGrantOperation), - ("P0004", SqlState::AssertFailure), - ("0F000", SqlState::LocatorException), - ("42611", SqlState::InvalidColumnDefinition), - ("2200L", SqlState::NotAnXmlDocument), - ("2200C", SqlState::InvalidUseOfEscapeCharacter), - ("40003", SqlState::StatementCompletionUnknown), - ("HV091", SqlState::FdwInvalidDescriptorFieldIdentifier), - ("XX002", SqlState::IndexCorrupted), - ("44000", SqlState::WithCheckOptionViolation), - ("22P02", SqlState::InvalidTextRepresentation), - ("54000", SqlState::ProgramLimitExceeded), - ("24000", SqlState::InvalidCursorState), - ("HV000", SqlState::FdwError), - ("2201W", SqlState::InvalidRowCountInLimitClause), - ("42P09", SqlState::AmbiguousAlias), - ("F0001", SqlState::LockFileExists), - ("57P01", SqlState::AdminShutdown), - ("23001", SqlState::RestrictViolation), - ("42P11", SqlState::InvalidCursorDefinition), - ("22027", SqlState::TrimError), - ("42725", SqlState::AmbiguousFunction), - ("0L000", SqlState::InvalidGrantor), - ("22003", SqlState::NumericValueOutOfRange), - ("42702", SqlState::AmbiguousColumn), - ("42830", SqlState::InvalidForeignKey), - ("21000", SqlState::CardinalityViolation), - ("58000", SqlState::SystemError), - ("2BP01", SqlState::DependentObjectsStillExist), - ("2201F", SqlState::InvalidArgumentForPowerFunction), - ("0A000", SqlState::FeatureNotSupported), - ("42P20", SqlState::WindowingError), - ("28P01", SqlState::InvalidPassword), - ("25003", SqlState::InappropriateAccessModeForBranchTransaction), - ("01000", SqlState::Warning), - ("08006", SqlState::ConnectionFailure), - ("2200M", SqlState::InvalidXmlDocument), - ("0100C", SqlState::DynamicResultSetsReturned), - ("03000", SqlState::SqlStatementNotYetComplete), - ("3D000", SqlState::InvalidCatalogName), - ("2202E", SqlState::ArraySubscriptError), - ("HV006", SqlState::FdwInvalidDataTypeDescriptors), - ("42704", SqlState::UndefinedObject), - ("HV004", SqlState::FdwInvalidDataType), - ("HV00B", SqlState::FdwInvalidHandle), - ("54001", SqlState::StatementTooComplex), - ("2202G", SqlState::InvalidTablesampleRepeat), - ("HV024", SqlState::FdwInvalidAttributeValue), - ("2F002", SqlState::SqlRoutineModifyingSqlDataNotPermitted), - ("F0000", SqlState::ConfigFileError), - ("2D000", SqlState::InvalidTransactionTermination), - ("25004", SqlState::InappropriateIsolationLevelForBranchTransaction), - ("22P06", SqlState::NonstandardUseOfEscapeCharacter), - ("53100", SqlState::DiskFull), - ("42P10", SqlState::InvalidColumnReference), - ("58030", SqlState::IoError), - ("0P000", SqlState::InvalidRoleSpecification), - ("08007", SqlState::TransactionResolutionUnknown), - ("HV090", SqlState::FdwInvalidStringLengthOrBufferLength), - ("27000", SqlState::TriggeredDataChangeViolation), - ("0F001", SqlState::InvalidLocatorSpecification), - ("22023", SqlState::InvalidParameterValue), - ("22005", SqlState::ErrorInAssignment), - ("57000", SqlState::OperatorIntervention), - ("55P03", SqlState::LockNotAvailable), - ("3B000", SqlState::SavepointException), - ("09000", SqlState::TriggeredActionException), - ("23502", SqlState::NotNullViolation), - ("HV00D", SqlState::FdwInvalidOptionName), - ("58P01", SqlState::UndefinedFile), - ("40002", SqlState::TransactionIntegrityConstraintViolation), - ("25005", SqlState::NoActiveSqlTransactionForBranchTransaction), - ("42601", SqlState::SyntaxError), - ("22024", SqlState::UnterminatedCString), - ("22025", SqlState::InvalidEscapeSequence), - ("22018", SqlState::InvalidCharacterValueForCast), - ("42P22", SqlState::IndeterminateCollation), - ("P0001", SqlState::RaiseException), - ("42P04", SqlState::DuplicateDatabase), - ("2202H", SqlState::InvalidTablesampleArgument), - ("2F003", SqlState::SqlRoutineProhibitedSqlStatementAttempted), - ("22014", SqlState::InvalidArgumentForNtileFunction), - ("HV00M", SqlState::FdwUnableToCreateReply), - ("HV014", SqlState::FdwTooManyHandles), - ("08003", SqlState::ConnectionDoesNotExist), - ("42P01", SqlState::UndefinedTable), - ("57P04", SqlState::DatabaseDropped), - ("42P21", SqlState::CollationMismatch), - ("22009", SqlState::InvalidTimeZoneDisplacementValue), - ("42804", SqlState::DatatypeMismatch), - ("22016", SqlState::InvalidArgumentForNthValueFunction), - ("57014", SqlState::QueryCanceled), - ("42701", SqlState::DuplicateColumn), - ("P0003", SqlState::TooManyRows), - ("57P03", SqlState::CannotConnectNow), - ("20000", SqlState::CaseNotFound), - ("XX001", SqlState::DataCorrupted), - ("42883", SqlState::UndefinedFunction), - ("38000", SqlState::ExternalRoutineException), - ("39004", SqlState::ExternalRoutineInvocationNullValueNotAllowed), - ("P0000", SqlState::PlpgsqlError), - ("2B000", SqlState::DependentPrivilegeDescriptorsStillExist), - ("55006", SqlState::ObjectInUse), - ("40P01", SqlState::DeadlockDetected), - ("HV00R", SqlState::FdwTableNotFound), - ("39000", SqlState::ExternalRoutineInvocationException), - ("23514", SqlState::CheckViolation), - ("22000", SqlState::DataException), - ("22010", SqlState::InvalidIndicatorParameterValue), - ("53300", SqlState::TooManyConnections), - ("42P08", SqlState::AmbiguousParameter), - ("HV00K", SqlState::FdwReplyHandle), - ("22P05", SqlState::UntranslatableCharacter), - ("2F000", SqlState::SqlRoutineException), - ("HV010", SqlState::FdwFunctionSequenceError), - ("42846", SqlState::CannotCoerce), - ("25001", SqlState::ActiveSqlTransaction), - ("38004", SqlState::ForeignRoutineReadingSqlDataNotPermitted), - ("42P12", SqlState::InvalidDatabaseDefinition), - ("53200", SqlState::OutOfMemory), - ("42P19", SqlState::InvalidRecursion), - ("42803", SqlState::GroupingError), - ("54011", SqlState::TooManyColumns), - ("39001", SqlState::InvalidSqlstateReturned), - ("38003", SqlState::ForeignRoutineProhibitedSqlStatementAttempted), - ("34000", SqlState::InvalidCursorName), - ("42P18", SqlState::IndeterminateDatatype), - ("2200B", SqlState::EscapeCharacterConflict), - ("HV00N", SqlState::FdwUnableToEstablishConnection), - ("HV00P", SqlState::FdwNoSchemas), - ("42P06", SqlState::DuplicateSchema), - ("02001", SqlState::NoAdditionalDynamicResultSetsReturned), - ("HV00L", SqlState::FdwUnableToCreateExecution), ("57P02", SqlState::CrashShutdown), - ("08000", SqlState::ConnectionException), + ("3D000", SqlState::InvalidCatalogName), + ("3B000", SqlState::SavepointException), + ("42P10", SqlState::InvalidColumnReference), + ("54000", SqlState::ProgramLimitExceeded), + ("P0001", SqlState::RaiseException), + ("23000", SqlState::IntegrityConstraintViolation), ("2201G", SqlState::InvalidArgumentForWidthBucketFunction), - ("42622", SqlState::NameTooLong), - ("55000", SqlState::ObjectNotInPrerequisiteState), - ("40000", SqlState::TransactionRollback), - ("38002", SqlState::ForeignRoutineModifyingSqlDataNotPermitted), - ("22008", SqlState::DatetimeFieldOverflow), - ("01008", SqlState::ImplicitZeroBitPadding), - ("28000", SqlState::InvalidAuthorizationSpecification), + ("HV00K", SqlState::FdwReplyHandle), + ("24000", SqlState::InvalidCursorState), + ("08007", SqlState::TransactionResolutionUnknown), + ("08001", SqlState::SqlclientUnableToEstablishSqlconnection), ("0Z002", SqlState::StackedDiagnosticsAccessedWithoutActiveHandler), + ("0P000", SqlState::InvalidRoleSpecification), + ("2F004", SqlState::SqlRoutineReadingSqlDataNotPermitted), + ("58P01", SqlState::UndefinedFile), + ("58030", SqlState::IoError), + ("2D000", SqlState::InvalidTransactionTermination), + ("42P12", SqlState::InvalidDatabaseDefinition), + ("2200M", SqlState::InvalidXmlDocument), + ("2BP01", SqlState::DependentObjectsStillExist), + ("2201W", SqlState::InvalidRowCountInLimitClause), + ("42601", SqlState::SyntaxError), + ("2201X", SqlState::InvalidRowCountInResultOffsetClause), + ("01004", SqlState::WarningStringDataRightTruncation), + ("2F005", SqlState::FunctionExecutedNoReturnStatement), + ("42P19", SqlState::InvalidRecursion), + ("42P13", SqlState::InvalidFunctionDefinition), + ("0L000", SqlState::InvalidGrantor), + ("39P03", SqlState::EventTriggerProtocolViolated), + ("38001", SqlState::ContainingSqlNotPermitted), + ("F0000", SqlState::ConfigFileError), + ("22P06", SqlState::NonstandardUseOfEscapeCharacter), + ("39004", SqlState::ExternalRoutineInvocationNullValueNotAllowed), + ("2F002", SqlState::SqlRoutineModifyingSqlDataNotPermitted), + ("25002", SqlState::BranchTransactionAlreadyActive), + ("01000", SqlState::Warning), + ("42809", SqlState::WrongObjectType), + ("F0001", SqlState::LockFileExists), + ("42P04", SqlState::DuplicateDatabase), + ("53200", SqlState::OutOfMemory), + ("3B001", SqlState::InvalidSavepointSpecification), + ("42000", SqlState::SyntaxErrorOrAccessRuleViolation), + ("HV091", SqlState::FdwInvalidDescriptorFieldIdentifier), + ("27000", SqlState::TriggeredDataChangeViolation), + ("HV006", SqlState::FdwInvalidDataTypeDescriptors), + ("42725", SqlState::AmbiguousFunction), + ("08004", SqlState::SqlserverRejectedEstablishmentOfSqlconnection), + ("25006", SqlState::ReadOnlySqlTransaction), + ("22001", SqlState::DataStringDataRightTruncation), + ("57P04", SqlState::DatabaseDropped), + ("42P16", SqlState::InvalidTableDefinition), + ("HV005", SqlState::FdwColumnNameNotFound), + ("HV00D", SqlState::FdwInvalidOptionName), + ("42P01", SqlState::UndefinedTable), + ("22002", SqlState::NullValueNoIndicatorParameter), + ("22023", SqlState::InvalidParameterValue), + ("42803", SqlState::GroupingError), + ("42P02", SqlState::UndefinedParameter), + ("HV090", SqlState::FdwInvalidStringLengthOrBufferLength), + ("40000", SqlState::TransactionRollback), + ("42723", SqlState::DuplicateFunction), + ("22007", SqlState::InvalidDatetimeFormat), + ("01006", SqlState::PrivilegeNotRevoked), + ("40001", SqlState::SerializationFailure), + ("42883", SqlState::UndefinedFunction), ("02000", SqlState::NoData), + ("42P18", SqlState::IndeterminateDatatype), + ("42501", SqlState::InsufficientPrivilege), + ("22021", SqlState::CharacterNotInRepertoire), + ("22025", SqlState::InvalidEscapeSequence), + ("55P03", SqlState::LockNotAvailable), + ("22018", SqlState::InvalidCharacterValueForCast), + ("23505", SqlState::UniqueViolation), + ("22012", SqlState::DivisionByZero), + ("25P01", SqlState::NoActiveSqlTransaction), + ("HV00N", SqlState::FdwUnableToEstablishConnection), + ("44000", SqlState::WithCheckOptionViolation), + ("57000", SqlState::OperatorIntervention), + ("22010", SqlState::InvalidIndicatorParameterValue), + ("54023", SqlState::TooManyArguments), + ("25000", SqlState::InvalidTransactionState), + ("58P02", SqlState::DuplicateFile), + ("40002", SqlState::TransactionIntegrityConstraintViolation), + ("HV001", SqlState::FdwOutOfMemory), + ("2F003", SqlState::SqlRoutineProhibitedSqlStatementAttempted), + ("55006", SqlState::ObjectInUse), + ("23P01", SqlState::ExclusionViolation), + ("0B000", SqlState::InvalidTransactionInitiation), + ("42P17", SqlState::InvalidObjectDefinition), + ("2202H", SqlState::InvalidTablesampleArgument), + ("53100", SqlState::DiskFull), + ("HV009", SqlState::FdwInvalidUseOfNullPointer), + ("21000", SqlState::CardinalityViolation), + ("42702", SqlState::AmbiguousColumn), + ("2200T", SqlState::InvalidXmlProcessingInstruction), + ("53300", SqlState::TooManyConnections), + ("54001", SqlState::StatementTooComplex), + ("22003", SqlState::NumericValueOutOfRange), + ("39P01", SqlState::TriggerProtocolViolated), + ("54011", SqlState::TooManyColumns), + ("42939", SqlState::ReservedName), + ("42701", SqlState::DuplicateColumn), + ("22014", SqlState::InvalidArgumentForNtileFunction), + ("22024", SqlState::UnterminatedCString), + ("0Z000", SqlState::DiagnosticsException), + ("22009", SqlState::InvalidTimeZoneDisplacementValue), + ("42P20", SqlState::WindowingError), + ("0LP01", SqlState::InvalidGrantOperation), + ("2200S", SqlState::InvalidXmlComment), + ("XX000", SqlState::InternalError), + ("53400", SqlState::ConfigurationLimitExceeded), + ("25008", SqlState::HeldCursorRequiresSameIsolationLevel), + ("22P05", SqlState::UntranslatableCharacter), + ("HV024", SqlState::FdwInvalidAttributeValue), + ("00000", SqlState::SuccessfulCompletion), + ("22005", SqlState::ErrorInAssignment), + ("38003", SqlState::ForeignRoutineProhibitedSqlStatementAttempted), + ("25007", SqlState::SchemaAndDataStatementMixingNotSupported), + ("42804", SqlState::DatatypeMismatch), ]), }; @@ -884,6 +890,7 @@ impl SqlState { SqlState::SchemaAndDataStatementMixingNotSupported => "25007", SqlState::NoActiveSqlTransaction => "25P01", SqlState::InFailedSqlTransaction => "25P02", + SqlState::IdleInTransactionSessionTimeout => "25P03", SqlState::InvalidSqlStatementName => "26000", SqlState::TriggeredDataChangeViolation => "27000", SqlState::InvalidAuthorizationSpecification => "28000", @@ -984,6 +991,7 @@ impl SqlState { SqlState::IoError => "58030", SqlState::UndefinedFile => "58P01", SqlState::DuplicateFile => "58P02", + SqlState::SnapshotTooOld => "72000", SqlState::ConfigFileError => "F0000", SqlState::LockFileExists => "F0001", SqlState::FdwError => "HV000", diff --git a/src/transaction.rs b/src/transaction.rs index 02402f0c..396a45d7 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -217,7 +217,9 @@ impl<'conn> Transaction<'conn> { /// Like `Connection::prepare_cached`. /// - /// Note that the statement will be cached for the duration of the + /// # Note + /// + /// The statement will be cached for the duration of the /// connection, not just the duration of this transaction. pub fn prepare_cached(&self, query: &str) -> Result> { self.conn.prepare_cached(query) diff --git a/src/types/types.rs b/src/types/types.rs index f9fc75d8..0ca19eba 100644 --- a/src/types/types.rs +++ b/src/types/types.rs @@ -50,6 +50,8 @@ pub enum Type { JsonArray, /// SMGR - storage manager Smgr, + /// INDEX_AM_HANDLER + IndexAmHandler, /// POINT - geometric point '(x, y)' Point, /// LSEG - geometric line segment '(pt1,pt2)' @@ -363,6 +365,7 @@ impl Type { 194 => Some(Type::PgNodeTree), 199 => Some(Type::JsonArray), 210 => Some(Type::Smgr), + 325 => Some(Type::IndexAmHandler), 600 => Some(Type::Point), 601 => Some(Type::Lseg), 602 => Some(Type::Path), @@ -528,6 +531,7 @@ impl Type { Type::PgNodeTree => 194, Type::JsonArray => 199, Type::Smgr => 210, + Type::IndexAmHandler => 325, Type::Point => 600, Type::Lseg => 601, Type::Path => 602, @@ -759,6 +763,10 @@ impl Type { const V: &'static Kind = &Kind::Simple; V } + Type::IndexAmHandler => { + const V: &'static Kind = &Kind::Pseudo; + V + } Type::Point => { const V: &'static Kind = &Kind::Simple; V @@ -1340,6 +1348,7 @@ impl Type { Type::PgNodeTree => "pg_node_tree", Type::JsonArray => "_json", Type::Smgr => "smgr", + Type::IndexAmHandler => "index_am_handler", Type::Point => "point", Type::Lseg => "lseg", Type::Path => "path",