diff --git a/codegen/src/errcodes.txt b/codegen/src/errcodes.txt index be924d58..4f354717 100644 --- a/codegen/src/errcodes.txt +++ b/codegen/src/errcodes.txt @@ -2,7 +2,7 @@ # errcodes.txt # PostgreSQL error codes # -# Copyright (c) 2003-2016, PostgreSQL Global Development Group +# Copyright (c) 2003-2017, 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 @@ -188,6 +188,7 @@ Section: Class 22 - Data Exception 22004 E ERRCODE_NULL_VALUE_NOT_ALLOWED null_value_not_allowed 22002 E ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER null_value_no_indicator_parameter 22003 E ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE numeric_value_out_of_range +2200H E ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED sequence_generator_limit_exceeded 22026 E ERRCODE_STRING_DATA_LENGTH_MISMATCH string_data_length_mismatch 22001 E ERRCODE_STRING_DATA_RIGHT_TRUNCATION string_data_right_truncation 22011 E ERRCODE_SUBSTRING_ERROR substring_error @@ -326,6 +327,7 @@ Section: Class 42 - Syntax Error or Access Rule Violation 42P21 E ERRCODE_COLLATION_MISMATCH collation_mismatch 42P22 E ERRCODE_INDETERMINATE_COLLATION indeterminate_collation 42809 E ERRCODE_WRONG_OBJECT_TYPE wrong_object_type +428C9 E ERRCODE_GENERATED_ALWAYS generated_always # Note: for ERRCODE purposes, we divide namable objects into these categories: # databases, schemas, prepared statements, cursors, tables, columns, @@ -398,6 +400,7 @@ Section: Class 55 - Object Not In Prerequisite State 55006 E ERRCODE_OBJECT_IN_USE object_in_use 55P02 E ERRCODE_CANT_CHANGE_RUNTIME_PARAM cant_change_runtime_param 55P03 E ERRCODE_LOCK_NOT_AVAILABLE lock_not_available +55P04 E ERRCODE_UNSAFE_NEW_ENUM_VALUE_USAGE unsafe_new_enum_value_usage Section: Class 57 - Operator Intervention diff --git a/codegen/src/pg_range.h b/codegen/src/pg_range.h index 14d3b123..4ed57fe2 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-2016, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2017, 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 162239c7..345e9164 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-2016, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_type.h @@ -364,6 +364,14 @@ DATA(insert OID = 194 ( pg_node_tree PGNSP PGUID -1 f b S f t \054 0 0 0 pg_node DESCR("string representing an internal node tree"); #define PGNODETREEOID 194 +DATA(insert OID = 3361 ( pg_ndistinct PGNSP PGUID -1 f b S f t \054 0 0 0 pg_ndistinct_in pg_ndistinct_out pg_ndistinct_recv pg_ndistinct_send - - - i x f 0 -1 0 100 _null_ _null_ _null_ )); +DESCR("multivariate ndistinct coefficients"); +#define PGNDISTINCTOID 3361 + +DATA(insert OID = 3402 ( pg_dependencies PGNSP PGUID -1 f b S f t \054 0 0 0 pg_dependencies_in pg_dependencies_out pg_dependencies_recv pg_dependencies_send - - - i x f 0 -1 0 100 _null_ _null_ _null_ )); +DESCR("multivariate dependencies"); +#define PGDEPENDENCIESOID 3402 + DATA(insert OID = 32 ( pg_ddl_command PGNSP PGUID SIZEOF_POINTER t p P f t \054 0 0 0 pg_ddl_command_in pg_ddl_command_out pg_ddl_command_recv pg_ddl_command_send - - - ALIGNOF_POINTER p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("internal type for passing CollectedCommand"); #define PGDDLCOMMANDOID 32 @@ -418,7 +426,7 @@ DESCR("relative, limited-range time interval (Unix delta time)"); DATA(insert OID = 704 ( tinterval PGNSP PGUID 12 f b T f t \054 0 0 1025 tintervalin tintervalout tintervalrecv tintervalsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("(abstime,abstime), time interval"); #define TINTERVALOID 704 -DATA(insert OID = 705 ( unknown PGNSP PGUID -2 f b X f t \054 0 0 0 unknownin unknownout unknownrecv unknownsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); +DATA(insert OID = 705 ( unknown PGNSP PGUID -2 f p X f t \054 0 0 0 unknownin unknownout unknownrecv unknownsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR(""); #define UNKNOWNOID 705 @@ -441,6 +449,9 @@ DESCR("IP address/netmask, host address, netmask optional"); DATA(insert OID = 650 ( cidr PGNSP PGUID -1 f b I f t \054 0 0 651 cidr_in cidr_out cidr_recv cidr_send - - - i m f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("network IP address/netmask, network address"); #define CIDROID 650 +DATA(insert OID = 774 ( macaddr8 PGNSP PGUID 8 f b U f t \054 0 0 775 macaddr8_in macaddr8_out macaddr8_recv macaddr8_send - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); +DESCR("XX:XX:XX:XX:XX:XX:XX:XX, MAC address"); +#define MACADDR8OID 774 /* OIDS 900 - 999 */ @@ -482,6 +493,7 @@ DESCR("access control list"); #define ACLITEMOID 1033 DATA(insert OID = 1034 ( _aclitem PGNSP PGUID -1 f b A f t \054 0 1033 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1040 ( _macaddr PGNSP PGUID -1 f b A f t \054 0 829 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); +DATA(insert OID = 775 ( _macaddr8 PGNSP PGUID -1 f b A f t \054 0 774 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1041 ( _inet PGNSP PGUID -1 f b A f t \054 0 869 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 651 ( _cidr PGNSP PGUID -1 f b A f t \054 0 650 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1263 ( _cstring PGNSP PGUID -1 f b A f t \054 0 2275 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); diff --git a/postgres-shared/src/error/sqlstate.rs b/postgres-shared/src/error/sqlstate.rs index 556199e9..168a08cc 100644 --- a/postgres-shared/src/error/sqlstate.rs +++ b/postgres-shared/src/error/sqlstate.rs @@ -133,6 +133,8 @@ pub enum SqlState { NullValueNoIndicatorParameter, /// `22003` NumericValueOutOfRange, + /// `2200H` + SequenceGeneratorLimitExceeded, /// `22026` StringDataLengthMismatch, /// `22001` @@ -303,6 +305,8 @@ pub enum SqlState { IndeterminateCollation, /// `42809` WrongObjectType, + /// `428C9` + GeneratedAlways, /// `42703` UndefinedColumn, /// `42883` @@ -385,6 +389,8 @@ pub enum SqlState { CantChangeRuntimeParam, /// `55P03` LockNotAvailable, + /// `55P04` + UnsafeNewEnumValueUsage, /// `57000` OperatorIntervention, /// `57014` @@ -489,294 +495,298 @@ pub enum SqlState { static SQLSTATE_MAP: phf::Map<&'static str, SqlState> = ::phf::Map { key: 1897749892740154578, disps: ::phf::Slice::Static(&[ - (0, 1), - (4, 69), - (0, 8), + (1, 99), + (0, 0), + (1, 5), + (0, 3), + (0, 110), + (0, 54), + (0, 3), (0, 13), - (3, 37), + (0, 0), + (0, 24), + (0, 214), + (0, 52), + (1, 34), + (0, 33), + (0, 44), + (0, 130), + (0, 16), + (0, 187), + (0, 3), + (13, 168), + (0, 4), + (0, 19), + (0, 13), + (0, 87), (0, 0), (0, 108), - (1, 101), - (3, 114), - (2, 188), - (0, 130), - (0, 27), - (0, 3), - (1, 195), - (0, 5), - (3, 159), - (0, 216), - (0, 163), - (1, 0), + (0, 123), + (7, 181), + (0, 109), + (0, 32), (0, 0), - (0, 4), - (0, 74), - (0, 4), - (0, 127), - (0, 9), - (1, 86), - (1, 66), + (1, 69), + (1, 81), + (1, 219), + (0, 157), + (2, 41), + (8, 141), (0, 5), - (12, 171), - (0, 21), + (0, 0), + (1, 6), + (0, 3), + (1, 146), + (1, 227), (9, 94), - (0, 177), - (1, 153), - (0, 10), - (0, 7), - (70, 186), - (57, 206), - (1, 222), - (0, 27), - (0, 155), - (12, 37), - (0, 28), - (0, 161), - (8, 181), - (2, 231), - (133, 237), - (0, 173), - (8, 25), + (10, 158), + (29, 65), + (3, 2), + (0, 33), + (1, 94), ]), entries: ::phf::Slice::Static(&[ - ("02000", SqlState::NoData), ("23001", SqlState::RestrictViolation), - ("03000", SqlState::SqlStatementNotYetComplete), - ("22P04", SqlState::BadCopyFileFormat), - ("01000", SqlState::Warning), - ("22014", SqlState::InvalidArgumentForNtileFunction), - ("0Z002", SqlState::StackedDiagnosticsAccessedWithoutActiveHandler), - ("HV00L", SqlState::FdwUnableToCreateExecution), - ("2201F", SqlState::InvalidArgumentForPowerFunction), - ("HV007", SqlState::FdwInvalidColumnName), - ("25001", SqlState::ActiveSqlTransaction), - ("HV004", SqlState::FdwInvalidDataType), - ("09000", SqlState::TriggeredActionException), - ("01004", SqlState::WarningStringDataRightTruncation), - ("42712", SqlState::DuplicateAlias), - ("22011", SqlState::SubstringError), - ("42725", SqlState::AmbiguousFunction), - ("F0001", SqlState::LockFileExists), - ("39001", SqlState::InvalidSqlstateReturned), - ("HV00A", SqlState::FdwInvalidStringFormat), - ("42P18", SqlState::IndeterminateDatatype), - ("HV005", SqlState::FdwColumnNameNotFound), - ("22007", SqlState::InvalidDatetimeFormat), - ("02001", SqlState::NoAdditionalDynamicResultSetsReturned), - ("HV00N", SqlState::FdwUnableToEstablishConnection), - ("2F002", SqlState::SqlRoutineModifyingSqlDataNotPermitted), - ("2F005", SqlState::FunctionExecutedNoReturnStatement), - ("55000", SqlState::ObjectNotInPrerequisiteState), - ("42723", SqlState::DuplicateFunction), - ("HV024", SqlState::FdwInvalidAttributeValue), - ("0B000", SqlState::InvalidTransactionInitiation), - ("2200G", SqlState::MostSpecificTypeMismatch), - ("57000", SqlState::OperatorIntervention), - ("0100C", SqlState::DynamicResultSetsReturned), - ("42P19", SqlState::InvalidRecursion), - ("2D000", SqlState::InvalidTransactionTermination), - ("25000", SqlState::InvalidTransactionState), - ("39P02", SqlState::SrfProtocolViolated), - ("2201W", SqlState::InvalidRowCountInLimitClause), - ("XX000", SqlState::InternalError), - ("23505", SqlState::UniqueViolation), - ("2201E", SqlState::InvalidArgumentForLogarithm), - ("42P04", SqlState::DuplicateDatabase), - ("22016", SqlState::InvalidArgumentForNthValueFunction), - ("2200T", SqlState::InvalidXmlProcessingInstruction), - ("20000", SqlState::CaseNotFound), - ("HV000", SqlState::FdwError), - ("23502", SqlState::NotNullViolation), - ("01006", SqlState::PrivilegeNotRevoked), - ("25007", SqlState::SchemaAndDataStatementMixingNotSupported), - ("0LP01", SqlState::InvalidGrantOperation), - ("40003", SqlState::StatementCompletionUnknown), - ("HV00C", SqlState::FdwInvalidOptionIndex), - ("42611", SqlState::InvalidColumnDefinition), - ("2200M", SqlState::InvalidXmlDocument), - ("08004", SqlState::SqlserverRejectedEstablishmentOfSqlconnection), - ("40P01", SqlState::DeadlockDetected), - ("42P22", SqlState::IndeterminateCollation), - ("42704", SqlState::UndefinedObject), - ("22025", SqlState::InvalidEscapeSequence), - ("57P02", SqlState::CrashShutdown), - ("57P01", SqlState::AdminShutdown), - ("42702", SqlState::AmbiguousColumn), - ("54023", SqlState::TooManyArguments), - ("55P03", SqlState::LockNotAvailable), - ("42P07", SqlState::DuplicateTable), - ("23P01", SqlState::ExclusionViolation), - ("25P02", SqlState::InFailedSqlTransaction), - ("42P09", SqlState::AmbiguousAlias), - ("34000", SqlState::InvalidCursorName), - ("3B000", SqlState::SavepointException), - ("0P000", SqlState::InvalidRoleSpecification), - ("HV006", SqlState::FdwInvalidDataTypeDescriptors), - ("2200L", SqlState::NotAnXmlDocument), - ("08003", SqlState::ConnectionDoesNotExist), - ("57P03", SqlState::CannotConnectNow), - ("42000", SqlState::SyntaxErrorOrAccessRuleViolation), - ("42P15", SqlState::InvalidSchemaDefinition), - ("42602", SqlState::InvalidName), - ("58030", SqlState::IoError), - ("2200C", SqlState::InvalidUseOfEscapeCharacter), - ("01007", SqlState::PrivilegeNotGranted), - ("28P01", SqlState::InvalidPassword), - ("25002", SqlState::BranchTransactionAlreadyActive), - ("26000", SqlState::InvalidSqlStatementName), - ("22003", SqlState::NumericValueOutOfRange), - ("42710", SqlState::DuplicateObject), - ("42846", SqlState::CannotCoerce), - ("42P10", SqlState::InvalidColumnReference), ("42830", SqlState::InvalidForeignKey), - ("42622", SqlState::NameTooLong), - ("42P06", SqlState::DuplicateSchema), - ("08P01", SqlState::ProtocolViolation), - ("HV090", SqlState::FdwInvalidStringLengthOrBufferLength), - ("27000", SqlState::TriggeredDataChangeViolation), - ("25003", SqlState::InappropriateAccessModeForBranchTransaction), - ("3F000", SqlState::InvalidSchemaName), - ("22019", SqlState::InvalidEscapeCharacter), - ("01008", SqlState::ImplicitZeroBitPadding), - ("24000", SqlState::InvalidCursorState), - ("23503", SqlState::ForeignKeyViolation), - ("22021", SqlState::CharacterNotInRepertoire), - ("42P14", SqlState::InvalidPreparedStatementDefinition), - ("2202G", SqlState::InvalidTablesampleRepeat), - ("44000", SqlState::WithCheckOptionViolation), - ("HV00Q", SqlState::FdwSchemaNotFound), - ("HV001", SqlState::FdwOutOfMemory), - ("38001", SqlState::ContainingSqlNotPermitted), - ("2202E", SqlState::ArraySubscriptError), - ("53000", SqlState::InsufficientResources), - ("HV00R", SqlState::FdwTableNotFound), - ("P0004", SqlState::AssertFailure), - ("HV008", SqlState::FdwInvalidColumnNumber), - ("42809", SqlState::WrongObjectType), - ("22P06", SqlState::NonstandardUseOfEscapeCharacter), - ("HV014", SqlState::FdwTooManyHandles), - ("0A000", SqlState::FeatureNotSupported), - ("2200S", SqlState::InvalidXmlComment), - ("40000", SqlState::TransactionRollback), - ("38002", SqlState::ForeignRoutineModifyingSqlDataNotPermitted), - ("42501", SqlState::InsufficientPrivilege), - ("P0003", SqlState::TooManyRows), - ("57014", SqlState::QueryCanceled), - ("39P01", SqlState::TriggerProtocolViolated), + ("P0000", SqlState::PlpgsqlError), ("58000", SqlState::SystemError), - ("54001", SqlState::StatementTooComplex), - ("01P01", SqlState::DeprecatedFeature), - ("08007", SqlState::TransactionResolutionUnknown), - ("2202H", SqlState::InvalidTablesampleArgument), - ("2B000", SqlState::DependentPrivilegeDescriptorsStillExist), - ("2F000", SqlState::SqlRoutineException), - ("2200F", SqlState::ZeroLengthCharacterString), - ("HV00J", SqlState::FdwOptionNameNotFound), - ("0F001", SqlState::InvalidLocatorSpecification), + ("57P01", SqlState::AdminShutdown), + ("22P04", SqlState::BadCopyFileFormat), + ("42P05", SqlState::DuplicatePreparedStatement), + ("28000", SqlState::InvalidAuthorizationSpecification), + ("2202E", SqlState::ArraySubscriptError), + ("2F005", SqlState::FunctionExecutedNoReturnStatement), + ("53400", SqlState::ConfigurationLimitExceeded), + ("20000", SqlState::CaseNotFound), + ("25004", SqlState::InappropriateIsolationLevelForBranchTransaction), + ("09000", SqlState::TriggeredActionException), + ("42P10", SqlState::InvalidColumnReference), + ("39P03", SqlState::EventTriggerProtocolViolated), ("08000", SqlState::ConnectionException), - ("22024", SqlState::UnterminatedCString), - ("42P02", SqlState::UndefinedParameter), - ("42P01", SqlState::UndefinedTable), + ("08006", SqlState::ConnectionFailure), + ("2201W", SqlState::InvalidRowCountInLimitClause), + ("03000", SqlState::SqlStatementNotYetComplete), + ("22014", SqlState::InvalidArgumentForNtileFunction), + ("42611", SqlState::InvalidColumnDefinition), + ("42P11", SqlState::InvalidCursorDefinition), + ("2200N", SqlState::InvalidXmlContent), + ("57014", SqlState::QueryCanceled), + ("01003", SqlState::NullValueEliminatedInSetFunction), + ("01000", SqlState::Warning), + ("55P04", SqlState::UnsafeNewEnumValueUsage), + ("25003", SqlState::InappropriateAccessModeForBranchTransaction), + ("2200L", SqlState::NotAnXmlDocument), + ("42846", SqlState::CannotCoerce), + ("55P03", SqlState::LockNotAvailable), + ("08007", SqlState::TransactionResolutionUnknown), + ("XX000", SqlState::InternalError), ("22005", SqlState::ErrorInAssignment), - ("42939", SqlState::ReservedName), + ("22P03", SqlState::InvalidBinaryRepresentation), + ("2201X", SqlState::InvalidRowCountInResultOffsetClause), + ("54011", SqlState::TooManyColumns), + ("HV008", SqlState::FdwInvalidColumnNumber), + ("HV009", SqlState::FdwInvalidUseOfNullPointer), + ("0LP01", SqlState::InvalidGrantOperation), + ("42704", SqlState::UndefinedObject), ("25005", SqlState::NoActiveSqlTransactionForBranchTransaction), - ("21000", SqlState::CardinalityViolation), + ("25P03", SqlState::IdleInTransactionSessionTimeout), + ("44000", SqlState::WithCheckOptionViolation), + ("22024", SqlState::UnterminatedCString), + ("0L000", SqlState::InvalidGrantor), + ("40000", SqlState::TransactionRollback), + ("42P08", SqlState::AmbiguousParameter), + ("38000", SqlState::ExternalRoutineException), + ("42939", SqlState::ReservedName), + ("40001", SqlState::SerializationFailure), + ("HV00K", SqlState::FdwReplyHandle), + ("2F002", SqlState::SqlRoutineModifyingSqlDataNotPermitted), + ("HV001", SqlState::FdwOutOfMemory), + ("42P19", SqlState::InvalidRecursion), + ("HV002", SqlState::FdwDynamicParameterValueNeeded), + ("0A000", SqlState::FeatureNotSupported), + ("58P02", SqlState::DuplicateFile), + ("25006", SqlState::ReadOnlySqlTransaction), + ("22009", SqlState::InvalidTimeZoneDisplacementValue), + ("0F001", SqlState::InvalidLocatorSpecification), + ("P0002", SqlState::NoDataFound), + ("2F000", SqlState::SqlRoutineException), + ("01006", SqlState::PrivilegeNotRevoked), + ("22025", SqlState::InvalidEscapeSequence), + ("22027", SqlState::TrimError), + ("54001", SqlState::StatementTooComplex), + ("42602", SqlState::InvalidName), + ("54023", SqlState::TooManyArguments), + ("2200T", SqlState::InvalidXmlProcessingInstruction), + ("01007", SqlState::PrivilegeNotGranted), + ("22000", SqlState::DataException), + ("28P01", SqlState::InvalidPassword), + ("23514", SqlState::CheckViolation), + ("39P02", SqlState::SrfProtocolViolated), + ("57P02", SqlState::CrashShutdown), + ("42P03", SqlState::DuplicateCursor), + ("22021", SqlState::CharacterNotInRepertoire), + ("HV00P", SqlState::FdwNoSchemas), + ("42701", SqlState::DuplicateColumn), + ("42P15", SqlState::InvalidSchemaDefinition), + ("HV00B", SqlState::FdwInvalidHandle), + ("34000", SqlState::InvalidCursorName), + ("22P06", SqlState::NonstandardUseOfEscapeCharacter), + ("P0001", SqlState::RaiseException), + ("08P01", SqlState::ProtocolViolation), + ("42723", SqlState::DuplicateFunction), + ("08001", SqlState::SqlclientUnableToEstablishSqlconnection), + ("HV006", SqlState::FdwInvalidDataTypeDescriptors), + ("23000", SqlState::IntegrityConstraintViolation), + ("42712", SqlState::DuplicateAlias), + ("2201G", SqlState::InvalidArgumentForWidthBucketFunction), + ("2200F", SqlState::ZeroLengthCharacterString), + ("XX002", SqlState::IndexCorrupted), + ("53300", SqlState::TooManyConnections), + ("38002", SqlState::ForeignRoutineModifyingSqlDataNotPermitted), + ("22015", SqlState::IntervalFieldOverflow), + ("22P01", SqlState::FloatingPointException), + ("22012", SqlState::DivisionByZero), + ("XX001", SqlState::DataCorrupted), + ("0100C", SqlState::DynamicResultSetsReturned), + ("42P01", SqlState::UndefinedTable), + ("25002", SqlState::BranchTransactionAlreadyActive), + ("2D000", SqlState::InvalidTransactionTermination), + ("P0004", SqlState::AssertFailure), + ("2200C", SqlState::InvalidUseOfEscapeCharacter), + ("HV00R", SqlState::FdwTableNotFound), + ("22016", SqlState::InvalidArgumentForNthValueFunction), + ("01P01", SqlState::DeprecatedFeature), + ("F0000", SqlState::ConfigFileError), + ("0Z000", SqlState::DiagnosticsException), + ("42P02", SqlState::UndefinedParameter), + ("2200S", SqlState::InvalidXmlComment), + ("2200H", SqlState::SequenceGeneratorLimitExceeded), + ("HV00C", SqlState::FdwInvalidOptionIndex), + ("38004", SqlState::ForeignRoutineReadingSqlDataNotPermitted), + ("42703", SqlState::UndefinedColumn), + ("23503", SqlState::ForeignKeyViolation), + ("42000", SqlState::SyntaxErrorOrAccessRuleViolation), + ("22004", SqlState::DataNullValueNotAllowed), + ("25008", SqlState::HeldCursorRequiresSameIsolationLevel), ("22018", SqlState::InvalidCharacterValueForCast), ("22023", SqlState::InvalidParameterValue), - ("57P04", SqlState::DatabaseDropped), - ("54000", SqlState::ProgramLimitExceeded), - ("2201G", SqlState::InvalidArgumentForWidthBucketFunction), - ("42P12", SqlState::InvalidDatabaseDefinition), - ("42P13", SqlState::InvalidFunctionDefinition), - ("P0001", SqlState::RaiseException), + ("22011", SqlState::SubstringError), ("40002", SqlState::TransactionIntegrityConstraintViolation), - ("2201X", SqlState::InvalidRowCountInResultOffsetClause), - ("39P03", SqlState::EventTriggerProtocolViolated), - ("39004", SqlState::ExternalRoutineInvocationNullValueNotAllowed), - ("42P11", SqlState::InvalidCursorDefinition), - ("25004", SqlState::InappropriateIsolationLevelForBranchTransaction), - ("HV009", SqlState::FdwInvalidUseOfNullPointer), - ("22P05", SqlState::UntranslatableCharacter), - ("HV010", SqlState::FdwFunctionSequenceError), - ("55006", SqlState::ObjectInUse), - ("HV021", SqlState::FdwInconsistentDescriptorInformation), - ("2201B", SqlState::InvalidRegularExpression), - ("53400", SqlState::ConfigurationLimitExceeded), - ("42P16", SqlState::InvalidTableDefinition), - ("22027", SqlState::TrimError), - ("HV00B", SqlState::FdwInvalidHandle), - ("HV00K", SqlState::FdwReplyHandle), - ("3B001", SqlState::InvalidSavepointSpecification), - ("P0000", SqlState::PlpgsqlError), - ("P0002", SqlState::NoDataFound), - ("42701", SqlState::DuplicateColumn), - ("22022", SqlState::IndicatorOverflow), - ("42703", SqlState::UndefinedColumn), - ("22012", SqlState::DivisionByZero), - ("42601", SqlState::SyntaxError), - ("53300", SqlState::TooManyConnections), - ("2F004", SqlState::SqlRoutineReadingSqlDataNotPermitted), - ("22026", SqlState::StringDataLengthMismatch), - ("42P21", SqlState::CollationMismatch), - ("28000", SqlState::InvalidAuthorizationSpecification), - ("22000", SqlState::DataException), - ("22001", SqlState::DataStringDataRightTruncation), - ("00000", SqlState::SuccessfulCompletion), - ("42804", SqlState::DatatypeMismatch), - ("HV091", SqlState::FdwInvalidDescriptorFieldIdentifier), - ("42P17", SqlState::InvalidObjectDefinition), - ("HV002", SqlState::FdwDynamicParameterValueNeeded), - ("2BP01", SqlState::DependentObjectsStillExist), - ("22009", SqlState::InvalidTimeZoneDisplacementValue), - ("42P05", SqlState::DuplicatePreparedStatement), - ("42883", SqlState::UndefinedFunction), - ("22P01", SqlState::FloatingPointException), - ("55P02", SqlState::CantChangeRuntimeParam), - ("0L000", SqlState::InvalidGrantor), - ("54011", SqlState::TooManyColumns), - ("XX001", SqlState::DataCorrupted), - ("22008", SqlState::DatetimeFieldOverflow), - ("38004", SqlState::ForeignRoutineReadingSqlDataNotPermitted), - ("25P01", SqlState::NoActiveSqlTransaction), - ("22002", SqlState::NullValueNoIndicatorParameter), - ("22P02", SqlState::InvalidTextRepresentation), - ("23514", SqlState::CheckViolation), - ("58P01", SqlState::UndefinedFile), - ("3D000", SqlState::InvalidCatalogName), - ("HV00M", SqlState::FdwUnableToCreateReply), - ("0Z000", SqlState::DiagnosticsException), - ("38003", SqlState::ForeignRoutineProhibitedSqlStatementAttempted), - ("22015", SqlState::IntervalFieldOverflow), - ("40001", SqlState::SerializationFailure), ("42803", SqlState::GroupingError), - ("42P08", SqlState::AmbiguousParameter), - ("0F000", SqlState::LocatorException), - ("58P02", SqlState::DuplicateFile), - ("01003", SqlState::NullValueEliminatedInSetFunction), - ("38000", SqlState::ExternalRoutineException), - ("25006", SqlState::ReadOnlySqlTransaction), - ("HV00D", SqlState::FdwInvalidOptionName), - ("53200", SqlState::OutOfMemory), - ("2200N", SqlState::InvalidXmlContent), - ("08001", SqlState::SqlclientUnableToEstablishSqlconnection), - ("2200B", SqlState::EscapeCharacterConflict), - ("53100", SqlState::DiskFull), - ("25008", SqlState::HeldCursorRequiresSameIsolationLevel), - ("23000", SqlState::IntegrityConstraintViolation), - ("39000", SqlState::ExternalRoutineInvocationException), ("72000", SqlState::SnapshotTooOld), + ("HV010", SqlState::FdwFunctionSequenceError), + ("42809", SqlState::WrongObjectType), + ("42P16", SqlState::InvalidTableDefinition), + ("HV00D", SqlState::FdwInvalidOptionName), + ("39000", SqlState::ExternalRoutineInvocationException), + ("2202G", SqlState::InvalidTablesampleRepeat), + ("42601", SqlState::SyntaxError), + ("42622", SqlState::NameTooLong), + ("HV00L", SqlState::FdwUnableToCreateExecution), + ("25000", SqlState::InvalidTransactionState), + ("3B000", SqlState::SavepointException), + ("42P21", SqlState::CollationMismatch), + ("23505", SqlState::UniqueViolation), + ("22001", SqlState::DataStringDataRightTruncation), + ("02001", SqlState::NoAdditionalDynamicResultSetsReturned), + ("21000", SqlState::CardinalityViolation), + ("58P01", SqlState::UndefinedFile), + ("HV091", SqlState::FdwInvalidDescriptorFieldIdentifier), + ("25P01", SqlState::NoActiveSqlTransaction), + ("40P01", SqlState::DeadlockDetected), + ("HV021", SqlState::FdwInconsistentDescriptorInformation), + ("42P09", SqlState::AmbiguousAlias), + ("25007", SqlState::SchemaAndDataStatementMixingNotSupported), + ("23P01", SqlState::ExclusionViolation), + ("HV00J", SqlState::FdwOptionNameNotFound), + ("58030", SqlState::IoError), + ("HV004", SqlState::FdwInvalidDataType), + ("42710", SqlState::DuplicateObject), + ("HV090", SqlState::FdwInvalidStringLengthOrBufferLength), + ("42P18", SqlState::IndeterminateDatatype), + ("HV00M", SqlState::FdwUnableToCreateReply), + ("42804", SqlState::DatatypeMismatch), + ("24000", SqlState::InvalidCursorState), + ("HV007", SqlState::FdwInvalidColumnName), + ("2201E", SqlState::InvalidArgumentForLogarithm), + ("42P22", SqlState::IndeterminateCollation), + ("22P05", SqlState::UntranslatableCharacter), + ("42P07", SqlState::DuplicateTable), + ("2F004", SqlState::SqlRoutineReadingSqlDataNotPermitted), + ("23502", SqlState::NotNullViolation), + ("57000", SqlState::OperatorIntervention), + ("HV000", SqlState::FdwError), + ("42883", SqlState::UndefinedFunction), + ("2201B", SqlState::InvalidRegularExpression), ("2200D", SqlState::InvalidEscapeOctet), - ("22010", SqlState::InvalidIndicatorParameterValue), - ("42P20", SqlState::WindowingError), - ("XX002", SqlState::IndexCorrupted), - ("42P03", SqlState::DuplicateCursor), - ("08006", SqlState::ConnectionFailure), - ("F0000", SqlState::ConfigFileError), + ("42P06", SqlState::DuplicateSchema), + ("38003", SqlState::ForeignRoutineProhibitedSqlStatementAttempted), + ("22026", SqlState::StringDataLengthMismatch), + ("P0003", SqlState::TooManyRows), + ("3D000", SqlState::InvalidCatalogName), + ("0B000", SqlState::InvalidTransactionInitiation), + ("55006", SqlState::ObjectInUse), + ("53200", SqlState::OutOfMemory), + ("3F000", SqlState::InvalidSchemaName), + ("53100", SqlState::DiskFull), ("2F003", SqlState::SqlRoutineProhibitedSqlStatementAttempted), - ("22004", SqlState::DataNullValueNotAllowed), - ("HV00P", SqlState::FdwNoSchemas), - ("25P03", SqlState::IdleInTransactionSessionTimeout), - ("22P03", SqlState::InvalidBinaryRepresentation), + ("55P02", SqlState::CantChangeRuntimeParam), + ("01004", SqlState::WarningStringDataRightTruncation), + ("3B001", SqlState::InvalidSavepointSpecification), + ("2200G", SqlState::MostSpecificTypeMismatch), + ("428C9", SqlState::GeneratedAlways), + ("HV005", SqlState::FdwColumnNameNotFound), + ("2201F", SqlState::InvalidArgumentForPowerFunction), + ("22022", SqlState::IndicatorOverflow), + ("HV00Q", SqlState::FdwSchemaNotFound), + ("0F000", SqlState::LocatorException), + ("22002", SqlState::NullValueNoIndicatorParameter), + ("02000", SqlState::NoData), + ("2202H", SqlState::InvalidTablesampleArgument), + ("27000", SqlState::TriggeredDataChangeViolation), + ("2BP01", SqlState::DependentObjectsStillExist), + ("55000", SqlState::ObjectNotInPrerequisiteState), + ("39001", SqlState::InvalidSqlstateReturned), + ("08004", SqlState::SqlserverRejectedEstablishmentOfSqlconnection), + ("42P13", SqlState::InvalidFunctionDefinition), + ("HV024", SqlState::FdwInvalidAttributeValue), + ("22019", SqlState::InvalidEscapeCharacter), + ("54000", SqlState::ProgramLimitExceeded), + ("42501", SqlState::InsufficientPrivilege), + ("HV00A", SqlState::FdwInvalidStringFormat), + ("42702", SqlState::AmbiguousColumn), + ("53000", SqlState::InsufficientResources), + ("25P02", SqlState::InFailedSqlTransaction), + ("22010", SqlState::InvalidIndicatorParameterValue), + ("01008", SqlState::ImplicitZeroBitPadding), + ("HV014", SqlState::FdwTooManyHandles), + ("42P20", SqlState::WindowingError), + ("42725", SqlState::AmbiguousFunction), + ("F0001", SqlState::LockFileExists), + ("08003", SqlState::ConnectionDoesNotExist), + ("2200M", SqlState::InvalidXmlDocument), + ("22003", SqlState::NumericValueOutOfRange), + ("39004", SqlState::ExternalRoutineInvocationNullValueNotAllowed), + ("2200B", SqlState::EscapeCharacterConflict), + ("0P000", SqlState::InvalidRoleSpecification), + ("00000", SqlState::SuccessfulCompletion), + ("22P02", SqlState::InvalidTextRepresentation), + ("25001", SqlState::ActiveSqlTransaction), + ("HV00N", SqlState::FdwUnableToEstablishConnection), + ("39P01", SqlState::TriggerProtocolViolated), + ("2B000", SqlState::DependentPrivilegeDescriptorsStillExist), + ("22008", SqlState::DatetimeFieldOverflow), + ("42P14", SqlState::InvalidPreparedStatementDefinition), + ("57P04", SqlState::DatabaseDropped), + ("26000", SqlState::InvalidSqlStatementName), + ("42P17", SqlState::InvalidObjectDefinition), + ("42P04", SqlState::DuplicateDatabase), + ("38001", SqlState::ContainingSqlNotPermitted), + ("0Z002", SqlState::StackedDiagnosticsAccessedWithoutActiveHandler), + ("22007", SqlState::InvalidDatetimeFormat), + ("40003", SqlState::StatementCompletionUnknown), + ("42P12", SqlState::InvalidDatabaseDefinition), + ("57P03", SqlState::CannotConnectNow), ]), }; @@ -856,6 +866,7 @@ impl SqlState { SqlState::DataNullValueNotAllowed => "22004", SqlState::NullValueNoIndicatorParameter => "22002", SqlState::NumericValueOutOfRange => "22003", + SqlState::SequenceGeneratorLimitExceeded => "2200H", SqlState::StringDataLengthMismatch => "22026", SqlState::DataStringDataRightTruncation => "22001", SqlState::SubstringError => "22011", @@ -941,6 +952,7 @@ impl SqlState { SqlState::CollationMismatch => "42P21", SqlState::IndeterminateCollation => "42P22", SqlState::WrongObjectType => "42809", + SqlState::GeneratedAlways => "428C9", SqlState::UndefinedColumn => "42703", SqlState::UndefinedFunction => "42883", SqlState::UndefinedTable => "42P01", @@ -982,6 +994,7 @@ impl SqlState { SqlState::ObjectInUse => "55006", SqlState::CantChangeRuntimeParam => "55P02", SqlState::LockNotAvailable => "55P03", + SqlState::UnsafeNewEnumValueUsage => "55P04", SqlState::OperatorIntervention => "57000", SqlState::QueryCanceled => "57014", SqlState::AdminShutdown => "57P01", diff --git a/postgres-shared/src/types/type_gen.rs b/postgres-shared/src/types/type_gen.rs index 4decc375..241c64c3 100644 --- a/postgres-shared/src/types/type_gen.rs +++ b/postgres-shared/src/types/type_gen.rs @@ -86,6 +86,10 @@ pub enum Type { Circle, /// CIRCLE[] CircleArray, + /// MACADDR8 - XX:XX:XX:XX:XX:XX:XX:XX, MAC address + Macaddr8, + /// MACADDR8[] + Macaddr8Array, /// MONEY - monetary amounts, $d,ddd.cc Money, /// MONEY[] @@ -262,6 +266,10 @@ pub enum Type { PgLsnArray, /// TSM_HANDLER TsmHandler, + /// PG_NDISTINCT - multivariate ndistinct coefficients + PgNdistinct, + /// PG_DEPENDENCIES - multivariate dependencies + PgDependencies, /// ANYENUM Anyenum, /// TSVECTOR - text representation for text search @@ -383,6 +391,8 @@ impl Type { 705 => Some(Type::Unknown), 718 => Some(Type::Circle), 719 => Some(Type::CircleArray), + 774 => Some(Type::Macaddr8), + 775 => Some(Type::Macaddr8Array), 790 => Some(Type::Money), 791 => Some(Type::MoneyArray), 829 => Some(Type::Macaddr), @@ -471,6 +481,8 @@ impl Type { 3220 => Some(Type::PgLsn), 3221 => Some(Type::PgLsnArray), 3310 => Some(Type::TsmHandler), + 3361 => Some(Type::PgNdistinct), + 3402 => Some(Type::PgDependencies), 3500 => Some(Type::Anyenum), 3614 => Some(Type::TsVector), 3615 => Some(Type::Tsquery), @@ -549,6 +561,8 @@ impl Type { Type::Unknown => 705, Type::Circle => 718, Type::CircleArray => 719, + Type::Macaddr8 => 774, + Type::Macaddr8Array => 775, Type::Money => 790, Type::MoneyArray => 791, Type::Macaddr => 829, @@ -637,6 +651,8 @@ impl Type { Type::PgLsn => 3220, Type::PgLsnArray => 3221, Type::TsmHandler => 3310, + Type::PgNdistinct => 3361, + Type::PgDependencies => 3402, Type::Anyenum => 3500, Type::TsVector => 3614, Type::Tsquery => 3615, @@ -835,6 +851,14 @@ impl Type { const V: &'static Kind = &Kind::Array(Type::Circle); V } + Type::Macaddr8 => { + const V: &'static Kind = &Kind::Simple; + V + } + Type::Macaddr8Array => { + const V: &'static Kind = &Kind::Array(Type::Macaddr8); + V + } Type::Money => { const V: &'static Kind = &Kind::Simple; V @@ -1187,6 +1211,14 @@ impl Type { const V: &'static Kind = &Kind::Pseudo; V } + Type::PgNdistinct => { + const V: &'static Kind = &Kind::Simple; + V + } + Type::PgDependencies => { + const V: &'static Kind = &Kind::Simple; + V + } Type::Anyenum => { const V: &'static Kind = &Kind::Pseudo; V @@ -1366,6 +1398,8 @@ impl Type { Type::Unknown => "unknown", Type::Circle => "circle", Type::CircleArray => "_circle", + Type::Macaddr8 => "macaddr8", + Type::Macaddr8Array => "_macaddr8", Type::Money => "money", Type::MoneyArray => "_money", Type::Macaddr => "macaddr", @@ -1454,6 +1488,8 @@ impl Type { Type::PgLsn => "pg_lsn", Type::PgLsnArray => "_pg_lsn", Type::TsmHandler => "tsm_handler", + Type::PgNdistinct => "pg_ndistinct", + Type::PgDependencies => "pg_dependencies", Type::Anyenum => "anyenum", Type::TsVector => "tsvector", Type::Tsquery => "tsquery",