1use serde::{Deserialize, Serialize};
16
17#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
24#[non_exhaustive]
25pub enum PostgresErrorCode {
26 SuccessfulCompletion,
29
30 Warning,
33 DynamicResultSetsReturned,
35 ImplicitZeroBitPadding,
37 NullValueEliminatedInSetFunction,
39 PrivilegeNotGranted,
41 PrivilegeNotRevoked,
43 StringDataRightTruncation01004,
45 DeprecatedFeature,
47
48 NoData,
51 NoAdditionalDynamicResultSetsReturned,
53
54 SqlStatementNotYetComplete,
57
58 ConnectionException,
61 ConnectionDoesNotExist,
63 ConnectionFailure,
65 SqlclientUnableToEstablishSqlconnection,
67 SqlserverRejectedEstablishmentOfSqlconnection,
69 TransactionResolutionUnknown,
71 ProtocolViolation,
73
74 TriggeredActionException,
77
78 FeatureNotSupported,
81
82 InvalidTransactionInitiation,
85
86 LocatorException,
89 InvalidLocatorSpecification,
91
92 InvalidGrantor,
95 InvalidGrantOperation,
97
98 InvalidRoleSpecification,
101
102 DiagnosticsException,
105 StackedDiagnosticsAccessedWithoutActiveHandler,
107
108 CaseNotFound,
111
112 CardinalityViolation,
115
116 DataException,
119 ArraySubscriptError,
121 CharacterNotInRepertoire,
123 DatetimeFieldOverflow,
125 DivisionByZero,
127 ErrorInAssignment,
129 EscapeCharacterConflict,
131 IndicatorOverflow,
133 IntervalFieldOverflow,
135 InvalidArgumentForLogarithm,
137 InvalidArgumentForNtileFunction,
139 InvalidArgumentForNthValueFunction,
141 InvalidArgumentForPowerFunction,
143 InvalidArgumentForWidthBucketFunction,
145 InvalidCharacterValueForCast,
147 InvalidDatetimeFormat,
149 InvalidEscapeCharacter,
151 InvalidEscapeOctet,
153 InvalidEscapeSequence,
155 NonstandardUseOfEscapeCharacter,
157 InvalidIndicatorParameterValue,
159 InvalidParameterValue,
161 InvalidPrecedingOrFollowingSize,
163 InvalidRegularExpression,
165 InvalidRowCountInLimitClause,
167 InvalidRowCountInResultOffsetClause,
169 InvalidTablesampleArgument,
171 InvalidTablesampleRepeat,
173 InvalidTimeZoneDisplacementValue,
175 InvalidUseOfEscapeCharacter,
177 MostSpecificTypeMismatch,
179 NullValueNotAllowed22004,
181 NullValueNoIndicatorParameter,
183 NumericValueOutOfRange,
185 SequenceGeneratorLimitExceeded,
187 StringDataLengthMismatch,
189 StringDataRightTruncation22001,
191 SubstringError,
193 TrimError,
195 UnterminatedCString,
197 ZeroLengthCharacterString,
199 FloatingPointException,
201 InvalidTextRepresentation,
203 InvalidBinaryRepresentation,
205 BadCopyFileFormat,
207 UntranslatableCharacter,
209 NotAnXmlDocument,
211 InvalidXmlDocument,
213 InvalidXmlContent,
215 InvalidXmlComment,
217 InvalidXmlProcessingInstruction,
219 DuplicateJsonObjectKeyValue,
221 InvalidArgumentForSqlJsonDatetimeFunction,
223 InvalidJsonText,
225 InvalidSqlJsonSubscript,
227 MoreThanOneSqlJsonItem,
229 NoSqlJsonItem,
231 NonNumericSqlJsonItem,
233 NonUniqueKeysInAJsonObject,
235 SingletonSqlJsonItemRequired,
237 SqlJsonArrayNotFound,
239 SqlJsonMemberNotFound,
241 SqlJsonNumberNotFound,
243 SqlJsonObjectNotFound,
245 TooManyJsonArrayElements,
247 TooManyJsonObjectMembers,
249 SqlJsonScalarRequired,
251
252 IntegrityConstraintViolation,
255 RestrictViolation,
257 NotNullViolation,
259 ForeignKeyViolation,
261 UniqueViolation,
263 CheckViolation,
265 ExclusionViolation,
267
268 InvalidCursorState,
271
272 InvalidTransactionState,
275 ActiveSqlTransaction,
277 BranchTransactionAlreadyActive,
279 HeldCursorRequiresSameIsolationLevel,
281 InappropriateAccessModeForBranchTransaction,
283 InappropriateIsolationLevelForBranchTransaction,
285 NoActiveSqlTransactionForBranchTransaction,
287 ReadOnlySqlTransaction,
289 SchemaAndDataStatementMixingNotSupported,
291 NoActiveSqlTransaction,
293 InFailedSqlTransaction,
295 IdleInTransactionSessionTimeout,
297
298 InvalidSqlStatementName,
301
302 TriggeredDataChangeViolation,
305
306 InvalidAuthorizationSpecification,
309 InvalidPassword,
311
312 DependentPrivilegeDescriptorsStillExist,
315 DependentObjectsStillExist,
317
318 InvalidTransactionTermination,
321
322 SqlRoutineException,
325 FunctionExecutedNoReturnStatement,
327 ModifyingSqlDataNotPermitted2F002,
329 ProhibitedSqlStatementAttempted2F003,
331 ReadingSqlDataNotPermitted2F004,
333
334 InvalidCursorName,
337
338 ExternalRoutineException,
341 ContainingSqlNotPermitted,
343 ModifyingSqlDataNotPermitted38002,
345 ProhibitedSqlStatementAttempted38003,
347 ReadingSqlDataNotPermitted38004,
349
350 ExternalRoutineInvocationException,
353 InvalidSqlstateReturned,
355 NullValueNotAllowed39004,
357 TriggerProtocolViolated,
359 SrfProtocolViolated,
361 EventTriggerProtocolViolated,
363
364 SavepointException,
367 InvalidSavepointSpecification,
369
370 InvalidCatalogName,
373
374 InvalidSchemaName,
377
378 TransactionRollback,
381 TransactionIntegrityConstraintViolation,
383 SerializationFailure,
385 StatementCompletionUnknown,
387 DeadlockDetected,
389
390 SyntaxErrorOrAccessRuleViolation,
393 SyntaxError,
395 InsufficientPrivilege,
397 CannotCoerce,
399 GroupingError,
401 WindowingError,
403 InvalidRecursion,
405 InvalidForeignKey,
407 InvalidName,
409 NameTooLong,
411 ReservedName,
413 DatatypeMismatch,
415 IndeterminateDatatype,
417 CollationMismatch,
419 IndeterminateCollation,
421 WrongObjectType,
423 GeneratedAlways,
425 UndefinedColumn,
427 UndefinedFunction,
429 UndefinedTable,
431 UndefinedParameter,
433 UndefinedObject,
435 DuplicateColumn,
437 DuplicateCursor,
439 DuplicateDatabase,
441 DuplicateFunction,
443 DuplicatePreparedStatement,
445 DuplicateSchema,
447 DuplicateTable,
449 DuplicateAlias,
451 DuplicateObject,
453 AmbiguousColumn,
455 AmbiguousFunction,
457 AmbiguousParameter,
459 AmbiguousAlias,
461 InvalidColumnReference,
463 InvalidColumnDefinition,
465 InvalidCursorDefinition,
467 InvalidDatabaseDefinition,
469 InvalidFunctionDefinition,
471 InvalidPreparedStatementDefinition,
473 InvalidSchemaDefinition,
475 InvalidTableDefinition,
477 InvalidObjectDefinition,
479
480 WithCheckOptionViolation,
483
484 InsufficientResources,
487 DiskFull,
489 OutOfMemory53200,
491 TooManyConnections,
493 ConfigurationLimitExceeded,
495
496 ProgramLimitExceeded,
499 StatementTooComplex,
501 TooManyColumns,
503 TooManyArguments,
505
506 ObjectNotInPrerequisiteState,
509 ObjectInUse,
511 CantChangeRuntimeParam,
513 LockNotAvailable,
515 UnsafeNewEnumValueUsage,
517
518 OperatorIntervention,
521 QueryCanceled,
523 AdminShutdown,
525 CrashShutdown,
527 CannotConnectNow,
529 DatabaseDropped,
531
532 SystemError,
535 IoError,
537 UndefinedFile,
539 DuplicateFile,
541
542 SnapshotTooOld,
545
546 ConfigFileError,
549 LockFileExists,
551
552 FdwError,
555 FdwColumnNameNotFound,
557 FdwDynamicParameterValueNeeded,
559 FdwFunctionSequenceError,
561 FdwInconsistentDescriptorInformation,
563 FdwInvalidAttributeValue,
565 FdwInvalidColumnName,
567 FdwInvalidColumnNumber,
569 FdwInvalidDataType,
571 FdwInvalidDataTypeDescriptors,
573 FdwInvalidDescriptorFieldIdentifier,
575 FdwInvalidHandle,
577 FdwInvalidOptionIndex,
579 FdwInvalidOptionName,
581 FdwInvalidStringLengthOrBufferLength,
583 FdwInvalidStringFormat,
585 FdwInvalidUseOfNullPointer,
587 FdwTooManyHandles,
589 OutOfMemoryHV001,
591 FdwNoSchemas,
593 FdwOptionNameNotFound,
595 FdwReplyHandle,
597 FdwSchemaNotFound,
599 FdwTableNotFound,
601 FdwUnableToCreateExecution,
603 FdwUnableToCreateReply,
605 FdwUnableToEstablishConnection,
607
608 PlpgsqlError,
611 RaiseException,
613 NoDataFound,
615 TooManyRows,
617 AssertFailure,
619
620 InternalError,
623 DataCorrupted,
625 IndexCorrupted,
627}
628
629impl PostgresErrorCode {
630 pub fn is_success(self) -> bool {
632 self == PostgresErrorCode::SuccessfulCompletion
633 }
634
635 pub fn is_warning(self) -> bool {
637 self >= PostgresErrorCode::Warning && self < PostgresErrorCode::NoData
638 }
639
640 pub fn is_error(self) -> bool {
642 self >= PostgresErrorCode::NoData
643 }
644
645 pub const fn sqlstate(self) -> &'static str {
647 match self {
648 PostgresErrorCode::SuccessfulCompletion => "00000",
650 PostgresErrorCode::Warning => "01000",
652 PostgresErrorCode::DynamicResultSetsReturned => "0100C",
653 PostgresErrorCode::ImplicitZeroBitPadding => "01008",
654 PostgresErrorCode::NullValueEliminatedInSetFunction => "01003",
655 PostgresErrorCode::PrivilegeNotGranted => "01007",
656 PostgresErrorCode::PrivilegeNotRevoked => "01006",
657 PostgresErrorCode::StringDataRightTruncation01004 => "01004",
658 PostgresErrorCode::DeprecatedFeature => "01P01",
659 PostgresErrorCode::NoData => "02000",
661 PostgresErrorCode::NoAdditionalDynamicResultSetsReturned => "02001",
662 PostgresErrorCode::SqlStatementNotYetComplete => "03000",
664 PostgresErrorCode::ConnectionException => "08000",
666 PostgresErrorCode::ConnectionDoesNotExist => "08003",
667 PostgresErrorCode::ConnectionFailure => "08006",
668 PostgresErrorCode::SqlclientUnableToEstablishSqlconnection => "08001",
669 PostgresErrorCode::SqlserverRejectedEstablishmentOfSqlconnection => "08004",
670 PostgresErrorCode::TransactionResolutionUnknown => "08007",
671 PostgresErrorCode::ProtocolViolation => "08P01",
672 PostgresErrorCode::TriggeredActionException => "09000",
674 PostgresErrorCode::FeatureNotSupported => "0A000",
676 PostgresErrorCode::InvalidTransactionInitiation => "0B000",
678 PostgresErrorCode::LocatorException => "0F000",
680 PostgresErrorCode::InvalidLocatorSpecification => "0F001",
681 PostgresErrorCode::InvalidGrantor => "0L000",
683 PostgresErrorCode::InvalidGrantOperation => "0LP01",
684 PostgresErrorCode::InvalidRoleSpecification => "0P000",
686 PostgresErrorCode::DiagnosticsException => "0Z000",
688 PostgresErrorCode::StackedDiagnosticsAccessedWithoutActiveHandler => "0Z002",
689 PostgresErrorCode::CaseNotFound => "20000",
691 PostgresErrorCode::CardinalityViolation => "21000",
693 PostgresErrorCode::DataException => "22000",
695 PostgresErrorCode::ArraySubscriptError => "2202E",
696 PostgresErrorCode::CharacterNotInRepertoire => "22021",
697 PostgresErrorCode::DatetimeFieldOverflow => "22008",
698 PostgresErrorCode::DivisionByZero => "22012",
699 PostgresErrorCode::ErrorInAssignment => "22005",
700 PostgresErrorCode::EscapeCharacterConflict => "2200B",
701 PostgresErrorCode::IndicatorOverflow => "22022",
702 PostgresErrorCode::IntervalFieldOverflow => "22015",
703 PostgresErrorCode::InvalidArgumentForLogarithm => "2201E",
704 PostgresErrorCode::InvalidArgumentForNtileFunction => "22014",
705 PostgresErrorCode::InvalidArgumentForNthValueFunction => "22016",
706 PostgresErrorCode::InvalidArgumentForPowerFunction => "2201F",
707 PostgresErrorCode::InvalidArgumentForWidthBucketFunction => "2201G",
708 PostgresErrorCode::InvalidCharacterValueForCast => "22018",
709 PostgresErrorCode::InvalidDatetimeFormat => "22007",
710 PostgresErrorCode::InvalidEscapeCharacter => "22019",
711 PostgresErrorCode::InvalidEscapeOctet => "2200D",
712 PostgresErrorCode::InvalidEscapeSequence => "22025",
713 PostgresErrorCode::NonstandardUseOfEscapeCharacter => "22P06",
714 PostgresErrorCode::InvalidIndicatorParameterValue => "22010",
715 PostgresErrorCode::InvalidParameterValue => "22023",
716 PostgresErrorCode::InvalidPrecedingOrFollowingSize => "22013",
717 PostgresErrorCode::InvalidRegularExpression => "2201B",
718 PostgresErrorCode::InvalidRowCountInLimitClause => "2201W",
719 PostgresErrorCode::InvalidRowCountInResultOffsetClause => "2201X",
720 PostgresErrorCode::InvalidTablesampleArgument => "2202H",
721 PostgresErrorCode::InvalidTablesampleRepeat => "2202G",
722 PostgresErrorCode::InvalidTimeZoneDisplacementValue => "22009",
723 PostgresErrorCode::InvalidUseOfEscapeCharacter => "2200C",
724 PostgresErrorCode::MostSpecificTypeMismatch => "2200G",
725 PostgresErrorCode::NullValueNotAllowed22004 => "22004",
726 PostgresErrorCode::NullValueNoIndicatorParameter => "22002",
727 PostgresErrorCode::NumericValueOutOfRange => "22003",
728 PostgresErrorCode::SequenceGeneratorLimitExceeded => "2200H",
729 PostgresErrorCode::StringDataLengthMismatch => "22026",
730 PostgresErrorCode::StringDataRightTruncation22001 => "22001",
731 PostgresErrorCode::SubstringError => "22011",
732 PostgresErrorCode::TrimError => "22027",
733 PostgresErrorCode::UnterminatedCString => "22024",
734 PostgresErrorCode::ZeroLengthCharacterString => "2200F",
735 PostgresErrorCode::FloatingPointException => "22P01",
736 PostgresErrorCode::InvalidTextRepresentation => "22P02",
737 PostgresErrorCode::InvalidBinaryRepresentation => "22P03",
738 PostgresErrorCode::BadCopyFileFormat => "22P04",
739 PostgresErrorCode::UntranslatableCharacter => "22P05",
740 PostgresErrorCode::NotAnXmlDocument => "2200L",
741 PostgresErrorCode::InvalidXmlDocument => "2200M",
742 PostgresErrorCode::InvalidXmlContent => "2200N",
743 PostgresErrorCode::InvalidXmlComment => "2200S",
744 PostgresErrorCode::InvalidXmlProcessingInstruction => "2200T",
745 PostgresErrorCode::DuplicateJsonObjectKeyValue => "22030",
746 PostgresErrorCode::InvalidArgumentForSqlJsonDatetimeFunction => "22031",
747 PostgresErrorCode::InvalidJsonText => "22032",
748 PostgresErrorCode::InvalidSqlJsonSubscript => "22033",
749 PostgresErrorCode::MoreThanOneSqlJsonItem => "22034",
750 PostgresErrorCode::NoSqlJsonItem => "22035",
751 PostgresErrorCode::NonNumericSqlJsonItem => "22036",
752 PostgresErrorCode::NonUniqueKeysInAJsonObject => "22037",
753 PostgresErrorCode::SingletonSqlJsonItemRequired => "22038",
754 PostgresErrorCode::SqlJsonArrayNotFound => "22039",
755 PostgresErrorCode::SqlJsonMemberNotFound => "2203A",
756 PostgresErrorCode::SqlJsonNumberNotFound => "2203B",
757 PostgresErrorCode::SqlJsonObjectNotFound => "2203C",
758 PostgresErrorCode::TooManyJsonArrayElements => "2203D",
759 PostgresErrorCode::TooManyJsonObjectMembers => "2203E",
760 PostgresErrorCode::SqlJsonScalarRequired => "2203F",
761 PostgresErrorCode::IntegrityConstraintViolation => "23000",
763 PostgresErrorCode::RestrictViolation => "23001",
764 PostgresErrorCode::NotNullViolation => "23502",
765 PostgresErrorCode::ForeignKeyViolation => "23503",
766 PostgresErrorCode::UniqueViolation => "23505",
767 PostgresErrorCode::CheckViolation => "23514",
768 PostgresErrorCode::ExclusionViolation => "23P01",
769 PostgresErrorCode::InvalidCursorState => "24000",
771 PostgresErrorCode::InvalidTransactionState => "25000",
773 PostgresErrorCode::ActiveSqlTransaction => "25001",
774 PostgresErrorCode::BranchTransactionAlreadyActive => "25002",
775 PostgresErrorCode::HeldCursorRequiresSameIsolationLevel => "25008",
776 PostgresErrorCode::InappropriateAccessModeForBranchTransaction => "25003",
777 PostgresErrorCode::InappropriateIsolationLevelForBranchTransaction => "25004",
778 PostgresErrorCode::NoActiveSqlTransactionForBranchTransaction => "25005",
779 PostgresErrorCode::ReadOnlySqlTransaction => "25006",
780 PostgresErrorCode::SchemaAndDataStatementMixingNotSupported => "25007",
781 PostgresErrorCode::NoActiveSqlTransaction => "25P01",
782 PostgresErrorCode::InFailedSqlTransaction => "25P02",
783 PostgresErrorCode::IdleInTransactionSessionTimeout => "25P03",
784 PostgresErrorCode::InvalidSqlStatementName => "26000",
786 PostgresErrorCode::TriggeredDataChangeViolation => "27000",
788 PostgresErrorCode::InvalidAuthorizationSpecification => "28000",
790 PostgresErrorCode::InvalidPassword => "28P01",
791 PostgresErrorCode::DependentPrivilegeDescriptorsStillExist => "2B000",
793 PostgresErrorCode::DependentObjectsStillExist => "2BP01",
794 PostgresErrorCode::InvalidTransactionTermination => "2D000",
796 PostgresErrorCode::SqlRoutineException => "2F000",
798 PostgresErrorCode::FunctionExecutedNoReturnStatement => "2F005",
799 PostgresErrorCode::ModifyingSqlDataNotPermitted2F002 => "2F002",
800 PostgresErrorCode::ProhibitedSqlStatementAttempted2F003 => "2F003",
801 PostgresErrorCode::ReadingSqlDataNotPermitted2F004 => "2F004",
802 PostgresErrorCode::InvalidCursorName => "34000",
804 PostgresErrorCode::ExternalRoutineException => "38000",
806 PostgresErrorCode::ContainingSqlNotPermitted => "38001",
807 PostgresErrorCode::ModifyingSqlDataNotPermitted38002 => "38002",
808 PostgresErrorCode::ProhibitedSqlStatementAttempted38003 => "38003",
809 PostgresErrorCode::ReadingSqlDataNotPermitted38004 => "38004",
810 PostgresErrorCode::ExternalRoutineInvocationException => "39000",
812 PostgresErrorCode::InvalidSqlstateReturned => "39001",
813 PostgresErrorCode::NullValueNotAllowed39004 => "39004",
814 PostgresErrorCode::TriggerProtocolViolated => "39P01",
815 PostgresErrorCode::SrfProtocolViolated => "39P02",
816 PostgresErrorCode::EventTriggerProtocolViolated => "39P03",
817 PostgresErrorCode::SavepointException => "3B000",
819 PostgresErrorCode::InvalidSavepointSpecification => "3B001",
820 PostgresErrorCode::InvalidCatalogName => "3D000",
822 PostgresErrorCode::InvalidSchemaName => "3F000",
824 PostgresErrorCode::TransactionRollback => "40000",
826 PostgresErrorCode::TransactionIntegrityConstraintViolation => "40002",
827 PostgresErrorCode::SerializationFailure => "40001",
828 PostgresErrorCode::StatementCompletionUnknown => "40003",
829 PostgresErrorCode::DeadlockDetected => "40P01",
830 PostgresErrorCode::SyntaxErrorOrAccessRuleViolation => "42000",
832 PostgresErrorCode::SyntaxError => "42601",
833 PostgresErrorCode::InsufficientPrivilege => "42501",
834 PostgresErrorCode::CannotCoerce => "42846",
835 PostgresErrorCode::GroupingError => "42803",
836 PostgresErrorCode::WindowingError => "42P20",
837 PostgresErrorCode::InvalidRecursion => "42P19",
838 PostgresErrorCode::InvalidForeignKey => "42830",
839 PostgresErrorCode::InvalidName => "42602",
840 PostgresErrorCode::NameTooLong => "42622",
841 PostgresErrorCode::ReservedName => "42939",
842 PostgresErrorCode::DatatypeMismatch => "42804",
843 PostgresErrorCode::IndeterminateDatatype => "42P18",
844 PostgresErrorCode::CollationMismatch => "42P21",
845 PostgresErrorCode::IndeterminateCollation => "42P22",
846 PostgresErrorCode::WrongObjectType => "42809",
847 PostgresErrorCode::GeneratedAlways => "428C9",
848 PostgresErrorCode::UndefinedColumn => "42703",
849 PostgresErrorCode::UndefinedFunction => "42883",
850 PostgresErrorCode::UndefinedTable => "42P01",
851 PostgresErrorCode::UndefinedParameter => "42P02",
852 PostgresErrorCode::UndefinedObject => "42704",
853 PostgresErrorCode::DuplicateColumn => "42701",
854 PostgresErrorCode::DuplicateCursor => "42P03",
855 PostgresErrorCode::DuplicateDatabase => "42P04",
856 PostgresErrorCode::DuplicateFunction => "42723",
857 PostgresErrorCode::DuplicatePreparedStatement => "42P05",
858 PostgresErrorCode::DuplicateSchema => "42P06",
859 PostgresErrorCode::DuplicateTable => "42P07",
860 PostgresErrorCode::DuplicateAlias => "42712",
861 PostgresErrorCode::DuplicateObject => "42710",
862 PostgresErrorCode::AmbiguousColumn => "42702",
863 PostgresErrorCode::AmbiguousFunction => "42725",
864 PostgresErrorCode::AmbiguousParameter => "42P08",
865 PostgresErrorCode::AmbiguousAlias => "42P09",
866 PostgresErrorCode::InvalidColumnReference => "42P10",
867 PostgresErrorCode::InvalidColumnDefinition => "42611",
868 PostgresErrorCode::InvalidCursorDefinition => "42P11",
869 PostgresErrorCode::InvalidDatabaseDefinition => "42P12",
870 PostgresErrorCode::InvalidFunctionDefinition => "42P13",
871 PostgresErrorCode::InvalidPreparedStatementDefinition => "42P14",
872 PostgresErrorCode::InvalidSchemaDefinition => "42P15",
873 PostgresErrorCode::InvalidTableDefinition => "42P16",
874 PostgresErrorCode::InvalidObjectDefinition => "42P17",
875 PostgresErrorCode::WithCheckOptionViolation => "44000",
877 PostgresErrorCode::InsufficientResources => "53000",
879 PostgresErrorCode::DiskFull => "53100",
880 PostgresErrorCode::OutOfMemory53200 => "53200",
881 PostgresErrorCode::TooManyConnections => "53300",
882 PostgresErrorCode::ConfigurationLimitExceeded => "53400",
883 PostgresErrorCode::ProgramLimitExceeded => "54000",
885 PostgresErrorCode::StatementTooComplex => "54001",
886 PostgresErrorCode::TooManyColumns => "54011",
887 PostgresErrorCode::TooManyArguments => "54023",
888 PostgresErrorCode::ObjectNotInPrerequisiteState => "55000",
890 PostgresErrorCode::ObjectInUse => "55006",
891 PostgresErrorCode::CantChangeRuntimeParam => "55P02",
892 PostgresErrorCode::LockNotAvailable => "55P03",
893 PostgresErrorCode::UnsafeNewEnumValueUsage => "55P04",
894 PostgresErrorCode::OperatorIntervention => "57000",
896 PostgresErrorCode::QueryCanceled => "57014",
897 PostgresErrorCode::AdminShutdown => "57P01",
898 PostgresErrorCode::CrashShutdown => "57P02",
899 PostgresErrorCode::CannotConnectNow => "57P03",
900 PostgresErrorCode::DatabaseDropped => "57P04",
901 PostgresErrorCode::SystemError => "58000",
903 PostgresErrorCode::IoError => "58030",
904 PostgresErrorCode::UndefinedFile => "58P01",
905 PostgresErrorCode::DuplicateFile => "58P02",
906 PostgresErrorCode::SnapshotTooOld => "72000",
908 PostgresErrorCode::ConfigFileError => "F0000",
910 PostgresErrorCode::LockFileExists => "F0001",
911 PostgresErrorCode::FdwError => "HV000",
913 PostgresErrorCode::FdwColumnNameNotFound => "HV005",
914 PostgresErrorCode::FdwDynamicParameterValueNeeded => "HV002",
915 PostgresErrorCode::FdwFunctionSequenceError => "HV010",
916 PostgresErrorCode::FdwInconsistentDescriptorInformation => "HV021",
917 PostgresErrorCode::FdwInvalidAttributeValue => "HV024",
918 PostgresErrorCode::FdwInvalidColumnName => "HV007",
919 PostgresErrorCode::FdwInvalidColumnNumber => "HV008",
920 PostgresErrorCode::FdwInvalidDataType => "HV004",
921 PostgresErrorCode::FdwInvalidDataTypeDescriptors => "HV006",
922 PostgresErrorCode::FdwInvalidDescriptorFieldIdentifier => "HV091",
923 PostgresErrorCode::FdwInvalidHandle => "HV00B",
924 PostgresErrorCode::FdwInvalidOptionIndex => "HV00C",
925 PostgresErrorCode::FdwInvalidOptionName => "HV00D",
926 PostgresErrorCode::FdwInvalidStringLengthOrBufferLength => "HV090",
927 PostgresErrorCode::FdwInvalidStringFormat => "HV00A",
928 PostgresErrorCode::FdwInvalidUseOfNullPointer => "HV009",
929 PostgresErrorCode::FdwTooManyHandles => "HV014",
930 PostgresErrorCode::OutOfMemoryHV001 => "HV001",
931 PostgresErrorCode::FdwNoSchemas => "HV00P",
932 PostgresErrorCode::FdwOptionNameNotFound => "HV00J",
933 PostgresErrorCode::FdwReplyHandle => "HV00K",
934 PostgresErrorCode::FdwSchemaNotFound => "HV00Q",
935 PostgresErrorCode::FdwTableNotFound => "HV00R",
936 PostgresErrorCode::FdwUnableToCreateExecution => "HV00L",
937 PostgresErrorCode::FdwUnableToCreateReply => "HV00M",
938 PostgresErrorCode::FdwUnableToEstablishConnection => "HV00N",
939 PostgresErrorCode::PlpgsqlError => "P0000",
941 PostgresErrorCode::RaiseException => "P0001",
942 PostgresErrorCode::NoDataFound => "P0002",
943 PostgresErrorCode::TooManyRows => "P0003",
944 PostgresErrorCode::AssertFailure => "P0004",
945 PostgresErrorCode::InternalError => "XX000",
947 PostgresErrorCode::DataCorrupted => "XX001",
948 PostgresErrorCode::IndexCorrupted => "XX002",
949 }
950 }
951}