{"modulePath":"github.com/cockroachdb/cockroachdb-parser","version":"v0.25.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pgcode\n\nPackage pgcode defines the PostgreSQL 5-character support codes used throughout the CockroachDB source tree.\n\nNote that CockroachDB may not use the same codes as PostgreSQL for the same situations.\n\n## Variables\n\n```go\nvar (\n\t// Section: Class 00 - Successful Completion\n\tSuccessfulCompletion = MakeCode(\"00000\")\n\t// Section: Class 01 - Warning\n\tWarning                                 = MakeCode(\"01000\")\n\tWarningDynamicResultSetsReturned        = MakeCode(\"0100C\")\n\tWarningImplicitZeroBitPadding           = MakeCode(\"01008\")\n\tWarningNullValueEliminatedInSetFunction = MakeCode(\"01003\")\n\tWarningPrivilegeNotGranted              = MakeCode(\"01007\")\n\tWarningPrivilegeNotRevoked              = MakeCode(\"01006\")\n\tWarningStringDataRightTruncation        = MakeCode(\"01004\")\n\tWarningDeprecatedFeature                = MakeCode(\"01P01\")\n\t// Section: Class 02 - No Data (this is also a warning class per the SQL standard)\n\tNoData                                = MakeCode(\"02000\")\n\tNoAdditionalDynamicResultSetsReturned = MakeCode(\"02001\")\n\t// Section: Class 03 - SQL Statement Not Yet Complete\n\tSQLStatementNotYetComplete = MakeCode(\"03000\")\n\t// Section: Class 08 - Connection Exception\n\tConnectionException                           = MakeCode(\"08000\")\n\tConnectionDoesNotExist                        = MakeCode(\"08003\")\n\tConnectionFailure                             = MakeCode(\"08006\")\n\tSQLclientUnableToEstablishSQLconnection       = MakeCode(\"08001\")\n\tSQLserverRejectedEstablishmentOfSQLconnection = MakeCode(\"08004\")\n\tTransactionResolutionUnknown                  = MakeCode(\"08007\")\n\tProtocolViolation                             = MakeCode(\"08P01\")\n\t// Section: Class 09 - Triggered Action Exception\n\tTriggeredActionException = MakeCode(\"09000\")\n\t// Section: Class 0A - Feature Not Supported\n\tFeatureNotSupported = MakeCode(\"0A000\")\n\t// Section: Class 0B - Invalid Transaction Initiation\n\tInvalidTransactionInitiation = MakeCode(\"0B000\")\n\t// Section: Class 0F - Locator Exception\n\tLocatorException            = MakeCode(\"0F000\")\n\tInvalidLocatorSpecification = MakeCode(\"0F001\")\n\t// Section: Class 0L - Invalid Grantor\n\tInvalidGrantor        = MakeCode(\"0L000\")\n\tInvalidGrantOperation = MakeCode(\"0LP01\")\n\t// Section: Class 0P - Invalid Role Specification\n\tInvalidRoleSpecification = MakeCode(\"0P000\")\n\t// Section: Class 0Z - Diagnostics Exception\n\tDiagnosticsException                           = MakeCode(\"0Z000\")\n\tStackedDiagnosticsAccessedWithoutActiveHandler = MakeCode(\"0Z002\")\n\t// Section: Class 20 - Case Not Found\n\tCaseNotFound = MakeCode(\"20000\")\n\t// Section: Class 21 - Cardinality Violation\n\tCardinalityViolation = MakeCode(\"21000\")\n\t// Section: Class 22 - Data Exception\n\tDataException                         = MakeCode(\"22000\")\n\tArraySubscript                        = MakeCode(\"2202E\")\n\tCharacterNotInRepertoire              = MakeCode(\"22021\")\n\tDatetimeFieldOverflow                 = MakeCode(\"22008\")\n\tDivisionByZero                        = MakeCode(\"22012\")\n\tInvalidWindowFrameOffset              = MakeCode(\"22013\")\n\tErrorInAssignment                     = MakeCode(\"22005\")\n\tEscapeCharacterConflict               = MakeCode(\"2200B\")\n\tIndicatorOverflow                     = MakeCode(\"22022\")\n\tIntervalFieldOverflow                 = MakeCode(\"22015\")\n\tInvalidArgumentForLogarithm           = MakeCode(\"2201E\")\n\tInvalidArgumentForNtileFunction       = MakeCode(\"22014\")\n\tInvalidArgumentForNthValueFunction    = MakeCode(\"22016\")\n\tInvalidArgumentForPowerFunction       = MakeCode(\"2201F\")\n\tInvalidArgumentForWidthBucketFunction = MakeCode(\"2201G\")\n\tInvalidCharacterValueForCast          = MakeCode(\"22018\")\n\tInvalidDatetimeFormat                 = MakeCode(\"22007\")\n\tInvalidEscapeCharacter                = MakeCode(\"22019\")\n\tInvalidEscapeOctet                    = MakeCode(\"2200D\")\n\tInvalidEscapeSequence                 = MakeCode(\"22025\")\n\tNonstandardUseOfEscapeCharacter       = MakeCode(\"22P06\")\n\tInvalidIndicatorParameterValue        = MakeCode(\"22010\")\n\tInvalidParameterValue                 = MakeCode(\"22023\")\n\tInvalidRegularExpression              = MakeCode(\"2201B\")\n\tInvalidRowCountInLimitClause          = MakeCode(\"2201W\")\n\tInvalidRowCountInResultOffsetClause   = MakeCode(\"2201X\")\n\tInvalidTimeZoneDisplacementValue      = MakeCode(\"22009\")\n\tInvalidUseOfEscapeCharacter           = MakeCode(\"2200C\")\n\tMostSpecificTypeMismatch              = MakeCode(\"2200G\")\n\tNullValueNotAllowed                   = MakeCode(\"22004\")\n\tNullValueNoIndicatorParameter         = MakeCode(\"22002\")\n\tNumericValueOutOfRange                = MakeCode(\"22003\")\n\tSequenceGeneratorLimitExceeded        = MakeCode(\"2200H\")\n\tStringDataLengthMismatch              = MakeCode(\"22026\")\n\tStringDataRightTruncation             = MakeCode(\"22001\")\n\tSubstring                             = MakeCode(\"22011\")\n\tTrim                                  = MakeCode(\"22027\")\n\tUnterminatedCString                   = MakeCode(\"22024\")\n\tZeroLengthCharacterString             = MakeCode(\"2200F\")\n\tFloatingPointException                = MakeCode(\"22P01\")\n\tInvalidTextRepresentation             = MakeCode(\"22P02\")\n\tInvalidBinaryRepresentation           = MakeCode(\"22P03\")\n\tBadCopyFileFormat                     = MakeCode(\"22P04\")\n\tUntranslatableCharacter               = MakeCode(\"22P05\")\n\tNotAnXMLDocument                      = MakeCode(\"2200L\")\n\tInvalidXMLDocument                    = MakeCode(\"2200M\")\n\tInvalidXMLContent                     = MakeCode(\"2200N\")\n\tInvalidXMLComment                     = MakeCode(\"2200S\")\n\tInvalidXMLProcessingInstruction       = MakeCode(\"2200T\")\n\tInvalidSQLJSONSubscript               = MakeCode(\"22033\")\n\tMoreThanOneSQLJSONItem                = MakeCode(\"22034\")\n\tNoSQLJSONItem                         = MakeCode(\"22035\")\n\tNonNumericSQLJSONItem                 = MakeCode(\"22036\")\n\tNonUniqueKeysInJSONObject             = MakeCode(\"22037\")\n\tSingletonSQLJSONItemRequired          = MakeCode(\"22038\")\n\tSQLJSONArrayNotFound                  = MakeCode(\"22039\")\n\tSQLJSONMemberNotFound                 = MakeCode(\"2203A\")\n\tSQLJSONNumberNotFound                 = MakeCode(\"2203B\")\n\tSQLJSONObjectNotFound                 = MakeCode(\"2203C\")\n\tTooManyJSONArrayElements              = MakeCode(\"2203D\")\n\tTooManyJSONObjectMembers              = MakeCode(\"2203E\")\n\tSQLJSONScalarRequired                 = MakeCode(\"2203F\")\n\tSQLJSONItemCannotBeCastToTargetType   = MakeCode(\"2203G\")\n\t// Section: Class 23 - Integrity Constraint Violation\n\tIntegrityConstraintViolation = MakeCode(\"23000\")\n\tRestrictViolation            = MakeCode(\"23001\")\n\tNotNullViolation             = MakeCode(\"23502\")\n\tForeignKeyViolation          = MakeCode(\"23503\")\n\tUniqueViolation              = MakeCode(\"23505\")\n\tCheckViolation               = MakeCode(\"23514\")\n\tExclusionViolation           = MakeCode(\"23P01\")\n\t// Section: Class 24 - Invalid Cursor State\n\tInvalidCursorState = MakeCode(\"24000\")\n\t// Section: Class 25 - Invalid Transaction State\n\tInvalidTransactionState                         = MakeCode(\"25000\")\n\tActiveSQLTransaction                            = MakeCode(\"25001\")\n\tBranchTransactionAlreadyActive                  = MakeCode(\"25002\")\n\tHeldCursorRequiresSameIsolationLevel            = MakeCode(\"25008\")\n\tInappropriateAccessModeForBranchTransaction     = MakeCode(\"25003\")\n\tInappropriateIsolationLevelForBranchTransaction = MakeCode(\"25004\")\n\tNoActiveSQLTransactionForBranchTransaction      = MakeCode(\"25005\")\n\tReadOnlySQLTransaction                          = MakeCode(\"25006\")\n\tSchemaAndDataStatementMixingNotSupported        = MakeCode(\"25007\")\n\tNoActiveSQLTransaction                          = MakeCode(\"25P01\")\n\tInFailedSQLTransaction                          = MakeCode(\"25P02\")\n\t// Section: Class 26 - Invalid SQL Statement Name\n\tInvalidSQLStatementName = MakeCode(\"26000\")\n\t// Section: Class 27 - Triggered Data Change Violation\n\tTriggeredDataChangeViolation = MakeCode(\"27000\")\n\t// Section: Class 28 - Invalid Authorization Specification\n\tInvalidAuthorizationSpecification = MakeCode(\"28000\")\n\tInvalidPassword                   = MakeCode(\"28P01\")\n\t// Section: Class 2B - Dependent Privilege Descriptors Still Exist\n\tDependentPrivilegeDescriptorsStillExist = MakeCode(\"2B000\")\n\tDependentObjectsStillExist              = MakeCode(\"2BP01\")\n\t// Section: Class 2D - Invalid Transaction Termination\n\tInvalidTransactionTermination = MakeCode(\"2D000\")\n\t// Section: Class 2F - SQL Routine Exception\n\tRoutineExceptionFunctionExecutedNoReturnStatement = MakeCode(\"2F005\")\n\tRoutineExceptionModifyingSQLDataNotPermitted      = MakeCode(\"2F002\")\n\tRoutineExceptionProhibitedSQLStatementAttempted   = MakeCode(\"2F003\")\n\tRoutineExceptionReadingSQLDataNotPermitted        = MakeCode(\"2F004\")\n\t// Section: Class 34 - Invalid Cursor Name\n\tInvalidCursorName = MakeCode(\"34000\")\n\t// Section: Class 38 - External Routine Exception\n\tExternalRoutineException                       = MakeCode(\"38000\")\n\tExternalRoutineContainingSQLNotPermitted       = MakeCode(\"38001\")\n\tExternalRoutineModifyingSQLDataNotPermitted    = MakeCode(\"38002\")\n\tExternalRoutineProhibitedSQLStatementAttempted = MakeCode(\"38003\")\n\tExternalRoutineReadingSQLDataNotPermitted      = MakeCode(\"38004\")\n\t// Section: Class 39 - External Routine Invocation Exception\n\tExternalRoutineInvocationException     = MakeCode(\"39000\")\n\tExternalRoutineInvalidSQLstateReturned = MakeCode(\"39001\")\n\tExternalRoutineNullValueNotAllowed     = MakeCode(\"39004\")\n\tExternalRoutineTriggerProtocolViolated = MakeCode(\"39P01\")\n\tExternalRoutineSrfProtocolViolated     = MakeCode(\"39P02\")\n\t// Section: Class 3B - Savepoint Exception\n\tSavepointException            = MakeCode(\"3B000\")\n\tInvalidSavepointSpecification = MakeCode(\"3B001\")\n\t// Section: Class 3D - Invalid Catalog Name\n\tInvalidCatalogName = MakeCode(\"3D000\")\n\t// Section: Class 3F - Invalid Schema Name\n\tInvalidSchemaName = MakeCode(\"3F000\")\n\t// Section: Class 40 - Transaction Rollback\n\tTransactionRollback                     = MakeCode(\"40000\")\n\tTransactionIntegrityConstraintViolation = MakeCode(\"40002\")\n\tSerializationFailure                    = MakeCode(\"40001\")\n\tStatementCompletionUnknown              = MakeCode(\"40003\")\n\tDeadlockDetected                        = MakeCode(\"40P01\")\n\t// Section: Class 42 - Syntax Error or Access Rule Violation\n\tSyntaxErrorOrAccessRuleViolation   = MakeCode(\"42000\")\n\tSyntax                             = MakeCode(\"42601\")\n\tInsufficientPrivilege              = MakeCode(\"42501\")\n\tCannotCoerce                       = MakeCode(\"42846\")\n\tGrouping                           = MakeCode(\"42803\")\n\tWindowing                          = MakeCode(\"42P20\")\n\tInvalidRecursion                   = MakeCode(\"42P19\")\n\tInvalidForeignKey                  = MakeCode(\"42830\")\n\tInvalidName                        = MakeCode(\"42602\")\n\tNameTooLong                        = MakeCode(\"42622\")\n\tReservedName                       = MakeCode(\"42939\")\n\tDatatypeMismatch                   = MakeCode(\"42804\")\n\tIndeterminateDatatype              = MakeCode(\"42P18\")\n\tCollationMismatch                  = MakeCode(\"42P21\")\n\tIndeterminateCollation             = MakeCode(\"42P22\")\n\tWrongObjectType                    = MakeCode(\"42809\")\n\tGeneratedAlways                    = MakeCode(\"428C9\")\n\tUndefinedColumn                    = MakeCode(\"42703\")\n\tUndefinedCursor                    = MakeCode(\"34000\")\n\tUndefinedDatabase                  = MakeCode(\"3D000\")\n\tUndefinedFunction                  = MakeCode(\"42883\")\n\tUndefinedPreparedStatement         = MakeCode(\"26000\")\n\tUndefinedSchema                    = MakeCode(\"3F000\")\n\tUndefinedTable                     = MakeCode(\"42P01\")\n\tUndefinedParameter                 = MakeCode(\"42P02\")\n\tUndefinedObject                    = MakeCode(\"42704\")\n\tDuplicateColumn                    = MakeCode(\"42701\")\n\tDuplicateCursor                    = MakeCode(\"42P03\")\n\tDuplicateDatabase                  = MakeCode(\"42P04\")\n\tDuplicateFunction                  = MakeCode(\"42723\")\n\tDuplicatePreparedStatement         = MakeCode(\"42P05\")\n\tDuplicateSchema                    = MakeCode(\"42P06\")\n\tDuplicateRelation                  = MakeCode(\"42P07\")\n\tDuplicateAlias                     = MakeCode(\"42712\")\n\tDuplicateObject                    = MakeCode(\"42710\")\n\tAmbiguousColumn                    = MakeCode(\"42702\")\n\tAmbiguousFunction                  = MakeCode(\"42725\")\n\tAmbiguousParameter                 = MakeCode(\"42P08\")\n\tAmbiguousAlias                     = MakeCode(\"42P09\")\n\tInvalidColumnReference             = MakeCode(\"42P10\")\n\tInvalidColumnDefinition            = MakeCode(\"42611\")\n\tInvalidCursorDefinition            = MakeCode(\"42P11\")\n\tInvalidDatabaseDefinition          = MakeCode(\"42P12\")\n\tInvalidFunctionDefinition          = MakeCode(\"42P13\")\n\tInvalidPreparedStatementDefinition = MakeCode(\"42P14\")\n\tInvalidSchemaDefinition            = MakeCode(\"42P15\")\n\tInvalidTableDefinition             = MakeCode(\"42P16\")\n\tInvalidObjectDefinition            = MakeCode(\"42P17\")\n\tFileAlreadyExists                  = MakeCode(\"42C01\")\n\t// Section: Class 44 - WITH CHECK OPTION Violation\n\tWithCheckOptionViolation = MakeCode(\"44000\")\n\t// Section: Class 53 - Insufficient Resources\n\tInsufficientResources      = MakeCode(\"53000\")\n\tDiskFull                   = MakeCode(\"53100\")\n\tOutOfMemory                = MakeCode(\"53200\")\n\tTooManyConnections         = MakeCode(\"53300\")\n\tConfigurationLimitExceeded = MakeCode(\"53400\")\n\t// Section: Class 54 - Program Limit Exceeded\n\tProgramLimitExceeded = MakeCode(\"54000\")\n\tStatementTooComplex  = MakeCode(\"54001\")\n\tTooManyColumns       = MakeCode(\"54011\")\n\tTooManyArguments     = MakeCode(\"54023\")\n\t// Section: Class 55 - Object Not In Prerequisite State\n\tObjectNotInPrerequisiteState = MakeCode(\"55000\")\n\tObjectInUse                  = MakeCode(\"55006\")\n\tCantChangeRuntimeParam       = MakeCode(\"55P02\")\n\tLockNotAvailable             = MakeCode(\"55P03\")\n\t// Section: Class 57 - Operator Intervention\n\tOperatorIntervention = MakeCode(\"57000\")\n\tQueryCanceled        = MakeCode(\"57014\")\n\tAdminShutdown        = MakeCode(\"57P01\")\n\tCrashShutdown        = MakeCode(\"57P02\")\n\tCannotConnectNow     = MakeCode(\"57P03\")\n\tDatabaseDropped      = MakeCode(\"57P04\")\n\t// Section: Class 58 - System Error\n\tSystem        = MakeCode(\"58000\")\n\tIo            = MakeCode(\"58030\")\n\tUndefinedFile = MakeCode(\"58P01\")\n\tDuplicateFile = MakeCode(\"58P02\")\n\t// Section: Class F0 - Configuration File Error\n\tConfigFile     = MakeCode(\"F0000\")\n\tLockFileExists = MakeCode(\"F0001\")\n\t// Section: Class HV - Foreign Data Wrapper Error (SQL/MED)\n\tFdwError                             = MakeCode(\"HV000\")\n\tFdwColumnNameNotFound                = MakeCode(\"HV005\")\n\tFdwDynamicParameterValueNeeded       = MakeCode(\"HV002\")\n\tFdwFunctionSequenceError             = MakeCode(\"HV010\")\n\tFdwInconsistentDescriptorInformation = MakeCode(\"HV021\")\n\tFdwInvalidAttributeValue             = MakeCode(\"HV024\")\n\tFdwInvalidColumnName                 = MakeCode(\"HV007\")\n\tFdwInvalidColumnNumber               = MakeCode(\"HV008\")\n\tFdwInvalidDataType                   = MakeCode(\"HV004\")\n\tFdwInvalidDataTypeDescriptors        = MakeCode(\"HV006\")\n\tFdwInvalidDescriptorFieldIdentifier  = MakeCode(\"HV091\")\n\tFdwInvalidHandle                     = MakeCode(\"HV00B\")\n\tFdwInvalidOptionIndex                = MakeCode(\"HV00C\")\n\tFdwInvalidOptionName                 = MakeCode(\"HV00D\")\n\tFdwInvalidStringLengthOrBufferLength = MakeCode(\"HV090\")\n\tFdwInvalidStringFormat               = MakeCode(\"HV00A\")\n\tFdwInvalidUseOfNullPointer           = MakeCode(\"HV009\")\n\tFdwTooManyHandles                    = MakeCode(\"HV014\")\n\tFdwOutOfMemory                       = MakeCode(\"HV001\")\n\tFdwNoSchemas                         = MakeCode(\"HV00P\")\n\tFdwOptionNameNotFound                = MakeCode(\"HV00J\")\n\tFdwReplyHandle                       = MakeCode(\"HV00K\")\n\tFdwSchemaNotFound                    = MakeCode(\"HV00Q\")\n\tFdwTableNotFound                     = MakeCode(\"HV00R\")\n\tFdwUnableToCreateExecution           = MakeCode(\"HV00L\")\n\tFdwUnableToCreateReply               = MakeCode(\"HV00M\")\n\tFdwUnableToEstablishConnection       = MakeCode(\"HV00N\")\n\t// Section: Class P0 - PL/pgSQL Error\n\tPLpgSQL        = MakeCode(\"P0000\")\n\tRaiseException = MakeCode(\"P0001\")\n\tNoDataFound    = MakeCode(\"P0002\")\n\tTooManyRows    = MakeCode(\"P0003\")\n\tAssertFailure  = MakeCode(\"P0004\")\n\t// Section: Class XX - Internal Error\n\tInternal       = MakeCode(\"XX000\")\n\tDataCorrupted  = MakeCode(\"XX001\")\n\tIndexCorrupted = MakeCode(\"XX002\")\n)\n```\nPG error codes from: [http://www.postgresql.org/docs/9.5/static/errcodes-appendix.html](http://www.postgresql.org/docs/9.5/static/errcodes-appendix.html). Specifically, errcodes.txt is copied from from Postgres' src/backend/utils/errcodes.txt.\n\nThe error definitions were generated using the generate.sh script, with a bit of manual tweaking performed afterwards.\n\n```go\nvar (\n\t// Uncategorized is used for errors that flow out to a client\n\t// when there's no code known yet.\n\tUncategorized = MakeCode(\"XXUUU\")\n\n\t// CCLRequired signals that a CCL binary is required to complete this\n\t// task.\n\tCCLRequired = MakeCode(\"XXC01\")\n\n\t// CCLValidLicenseRequired signals that a valid CCL license is\n\t// required to complete this task.\n\tCCLValidLicenseRequired = MakeCode(\"XXC02\")\n\n\t// TransactionCommittedWithSchemaChangeFailure signals that the\n\t// non-DDL payload of a transaction was committed successfully but\n\t// some DDL operation failed, without rolling back the rest of the\n\t// transaction.\n\t//\n\t// We define a separate code instead of reusing a code from\n\t// PostgreSQL (like StatementCompletionUnknown) because that makes\n\t// it easier to document the error (this code only occurs in this\n\t// particular situation) in a way that's unique to CockroachDB.\n\t//\n\t// We also use a \"XX\" code for this for several reasons:\n\t// - it needs to override any other pg code set \"underneath\" in the cause.\n\t// - it forces implementers of logic tests to be mindful about\n\t//   this situation. The logic test runner will remind the implementer\n\t//   that:\n\t//       serious error with code \"XXA00\" occurred; if expected,\n\t//       must use 'error pgcode XXA00 ...'\n\tTransactionCommittedWithSchemaChangeFailure = MakeCode(\"XXA00\")\n\n\t// ScalarOperationCannotRunWithoutFullSessionContext signals that an\n\t// operator or built-in function was used that requires a full session\n\t// context and thus cannot be run in a background job or away from the SQL\n\t// gateway.\n\tScalarOperationCannotRunWithoutFullSessionContext = MakeCode(\"22C01\")\n\n\t// SchemaChangeOccurred signals that a DDL change to the targets of a\n\t// CHANGEFEED has lead to its termination. If this error code is received\n\t// the CHANGEFEED will have previously emitted a resolved timestamp which\n\t// precedes the hlc timestamp of the relevant DDL transaction.\n\tSchemaChangeOccurred = MakeCode(\"55C01\")\n\n\t// NoPrimaryKey signals that a table descriptor is invalid because the table\n\t// does not have a primary key.\n\tNoPrimaryKey = MakeCode(\"55C02\")\n\n\t// RangeUnavailable signals that some data from the cluster cannot be\n\t// accessed (e.g. because all replicas awol).\n\tRangeUnavailable = MakeCode(\"58C00\")\n\n\t// InternalConnectionFailure refers to a networking error encountered\n\t// internally on a connection between different Cockroach nodes.\n\tInternalConnectionFailure = MakeCode(\"58C01\")\n\n\t// ProxyConnectionError is returned by the sqlproxyccl and it indicates a\n\t// problem establishing the connection through the proxy.\n\tProxyConnectionError = MakeCode(\"08C00\")\n\n\t// UnsatisfiableBoundedStaleness signals that the bounded staleness query\n\t// cannot be satisfied.\n\tUnsatisfiableBoundedStaleness = MakeCode(\"XCUBS\")\n\n\t// QueryNotRunningInHomeRegion signals that a query is not running in its\n\t// home region.\n\tQueryNotRunningInHomeRegion = MakeCode(\"XCHR1\")\n\n\t// QueryHasNoHomeRegion signals that a query has no home region.\n\tQueryHasNoHomeRegion = MakeCode(\"XCHR2\")\n\n\t// ExperimentalFeature signals that a feature we supported experimentally is being\n\t// used without the session variable being enabled.\n\tExperimentalFeature = MakeCode(\"XCEXF\")\n)\n```\n\n```go\nvar PLpgSQLConditionNameToCode = map[string][]string{\n\n\t\"successful_completion\": {\"00000\"},\n\n\t\"warning\":                               {\"01000\"},\n\t\"dynamic_result_sets_returned\":          {\"0100C\"},\n\t\"implicit_zero_bit_padding\":             {\"01008\"},\n\t\"null_value_eliminated_in_set_function\": {\"01003\"},\n\t\"privilege_not_granted\":                 {\"01007\"},\n\t\"privilege_not_revoked\":                 {\"01006\"},\n\t\"deprecated_feature\":                    {\"01P01\"},\n\n\t\"no_data\": {\"02000\"},\n\t\"no_additional_dynamic_result_sets_returned\": {\"02001\"},\n\n\t\"sql_statement_not_yet_complete\": {\"03000\"},\n\n\t\"connection_exception\":                              {\"08000\"},\n\t\"connection_does_not_exist\":                         {\"08003\"},\n\t\"connection_failure\":                                {\"08006\"},\n\t\"sqlclient_unable_to_establish_sqlconnection\":       {\"08001\"},\n\t\"sqlserver_rejected_establishment_of_sqlconnection\": {\"08004\"},\n\t\"transaction_resolution_unknown\":                    {\"08007\"},\n\t\"protocol_violation\":                                {\"08P01\"},\n\n\t\"triggered_action_exception\": {\"09000\"},\n\n\t\"feature_not_supported\": {\"0A000\"},\n\n\t\"invalid_transaction_initiation\": {\"0B000\"},\n\n\t\"locator_exception\":             {\"0F000\"},\n\t\"invalid_locator_specification\": {\"0F001\"},\n\n\t\"invalid_grantor\":         {\"0L000\"},\n\t\"invalid_grant_operation\": {\"0LP01\"},\n\n\t\"invalid_role_specification\": {\"0P000\"},\n\n\t\"diagnostics_exception\":                               {\"0Z000\"},\n\t\"stacked_diagnostics_accessed_without_active_handler\": {\"0Z002\"},\n\n\t\"case_not_found\": {\"20000\"},\n\n\t\"cardinality_violation\": {\"21000\"},\n\n\t\"data_exception\":                             {\"22000\"},\n\t\"array_subscript_error\":                      {\"2202E\"},\n\t\"character_not_in_repertoire\":                {\"22021\"},\n\t\"datetime_field_overflow\":                    {\"22008\"},\n\t\"division_by_zero\":                           {\"22012\"},\n\t\"error_in_assignment\":                        {\"22005\"},\n\t\"escape_character_conflict\":                  {\"2200B\"},\n\t\"indicator_overflow\":                         {\"22022\"},\n\t\"interval_field_overflow\":                    {\"22015\"},\n\t\"invalid_argument_for_logarithm\":             {\"2201E\"},\n\t\"invalid_argument_for_ntile_function\":        {\"22014\"},\n\t\"invalid_argument_for_nth_value_function\":    {\"22016\"},\n\t\"invalid_argument_for_power_function\":        {\"2201F\"},\n\t\"invalid_argument_for_width_bucket_function\": {\"2201G\"},\n\t\"invalid_character_value_for_cast\":           {\"22018\"},\n\t\"invalid_datetime_format\":                    {\"22007\"},\n\t\"invalid_escape_character\":                   {\"22019\"},\n\t\"invalid_escape_octet\":                       {\"2200D\"},\n\t\"invalid_escape_sequence\":                    {\"22025\"},\n\t\"nonstandard_use_of_escape_character\":        {\"22P06\"},\n\t\"invalid_indicator_parameter_value\":          {\"22010\"},\n\t\"invalid_parameter_value\":                    {\"22023\"},\n\t\"invalid_regular_expression\":                 {\"2201B\"},\n\t\"invalid_row_count_in_limit_clause\":          {\"2201W\"},\n\t\"invalid_row_count_in_result_offset_clause\":  {\"2201X\"},\n\t\"invalid_tablesample_argument\":               {\"2202H\"},\n\t\"invalid_tablesample_repeat\":                 {\"2202G\"},\n\t\"invalid_time_zone_displacement_value\":       {\"22009\"},\n\t\"invalid_use_of_escape_character\":            {\"2200C\"},\n\t\"most_specific_type_mismatch\":                {\"2200G\"},\n\t\"null_value_no_indicator_parameter\":          {\"22002\"},\n\t\"numeric_value_out_of_range\":                 {\"22003\"},\n\t\"string_data_length_mismatch\":                {\"22026\"},\n\t\"substring_error\":                            {\"22011\"},\n\t\"trim_error\":                                 {\"22027\"},\n\t\"unterminated_c_string\":                      {\"22024\"},\n\t\"zero_length_character_string\":               {\"2200F\"},\n\t\"floating_point_exception\":                   {\"22P01\"},\n\t\"invalid_text_representation\":                {\"22P02\"},\n\t\"invalid_binary_representation\":              {\"22P03\"},\n\t\"bad_copy_file_format\":                       {\"22P04\"},\n\t\"untranslatable_character\":                   {\"22P05\"},\n\t\"not_an_xml_document\":                        {\"2200L\"},\n\t\"invalid_xml_document\":                       {\"2200M\"},\n\t\"invalid_xml_content\":                        {\"2200N\"},\n\t\"invalid_xml_comment\":                        {\"2200S\"},\n\t\"invalid_xml_processing_instruction\":         {\"2200T\"},\n\n\t\"integrity_constraint_violation\": {\"23000\"},\n\t\"restrict_violation\":             {\"23001\"},\n\t\"not_null_violation\":             {\"23502\"},\n\t\"foreign_key_violation\":          {\"23503\"},\n\t\"unique_violation\":               {\"23505\"},\n\t\"check_violation\":                {\"23514\"},\n\t\"exclusion_violation\":            {\"23P01\"},\n\n\t\"invalid_cursor_state\": {\"24000\"},\n\n\t\"invalid_transaction_state\":                            {\"25000\"},\n\t\"active_sql_transaction\":                               {\"25001\"},\n\t\"branch_transaction_already_active\":                    {\"25002\"},\n\t\"held_cursor_requires_same_isolation_level\":            {\"25008\"},\n\t\"inappropriate_access_mode_for_branch_transaction\":     {\"25003\"},\n\t\"inappropriate_isolation_level_for_branch_transaction\": {\"25004\"},\n\t\"no_active_sql_transaction_for_branch_transaction\":     {\"25005\"},\n\t\"read_only_sql_transaction\":                            {\"25006\"},\n\t\"schema_and_data_statement_mixing_not_supported\":       {\"25007\"},\n\t\"no_active_sql_transaction\":                            {\"25P01\"},\n\t\"in_failed_sql_transaction\":                            {\"25P02\"},\n\n\t\"invalid_sql_statement_name\": {\"26000\"},\n\n\t\"triggered_data_change_violation\": {\"27000\"},\n\n\t\"invalid_authorization_specification\": {\"28000\"},\n\t\"invalid_password\":                    {\"28P01\"},\n\n\t\"dependent_privilege_descriptors_still_exist\": {\"2B000\"},\n\t\"dependent_objects_still_exist\":               {\"2BP01\"},\n\n\t\"invalid_transaction_termination\": {\"2D000\"},\n\n\t\"sql_routine_exception\":                 {\"2F000\"},\n\t\"function_executed_no_return_statement\": {\"2F005\"},\n\n\t\"invalid_cursor_name\": {\"34000\"},\n\n\t\"external_routine_exception\":   {\"38000\"},\n\t\"containing_sql_not_permitted\": {\"38001\"},\n\n\t\"external_routine_invocation_exception\": {\"39000\"},\n\t\"invalid_sqlstate_returned\":             {\"39001\"},\n\t\"trigger_protocol_violated\":             {\"39P01\"},\n\t\"srf_protocol_violated\":                 {\"39P02\"},\n\t\"event_trigger_protocol_violated\":       {\"39P03\"},\n\n\t\"savepoint_exception\":             {\"3B000\"},\n\t\"invalid_savepoint_specification\": {\"3B001\"},\n\n\t\"invalid_catalog_name\": {\"3D000\"},\n\n\t\"invalid_schema_name\": {\"3F000\"},\n\n\t\"transaction_rollback\":                       {\"40000\"},\n\t\"transaction_integrity_constraint_violation\": {\"40002\"},\n\t\"serialization_failure\":                      {\"40001\"},\n\t\"statement_completion_unknown\":               {\"40003\"},\n\t\"deadlock_detected\":                          {\"40P01\"},\n\n\t\"syntax_error_or_access_rule_violation\": {\"42000\"},\n\t\"syntax_error\":                          {\"42601\"},\n\t\"insufficient_privilege\":                {\"42501\"},\n\t\"cannot_coerce\":                         {\"42846\"},\n\t\"grouping_error\":                        {\"42803\"},\n\t\"windowing_error\":                       {\"42P20\"},\n\t\"invalid_recursion\":                     {\"42P19\"},\n\t\"invalid_foreign_key\":                   {\"42830\"},\n\t\"invalid_name\":                          {\"42602\"},\n\t\"name_too_long\":                         {\"42622\"},\n\t\"reserved_name\":                         {\"42939\"},\n\t\"datatype_mismatch\":                     {\"42804\"},\n\t\"indeterminate_datatype\":                {\"42P18\"},\n\t\"collation_mismatch\":                    {\"42P21\"},\n\t\"indeterminate_collation\":               {\"42P22\"},\n\t\"wrong_object_type\":                     {\"42809\"},\n\t\"undefined_column\":                      {\"42703\"},\n\t\"undefined_function\":                    {\"42883\"},\n\t\"undefined_table\":                       {\"42P01\"},\n\t\"undefined_parameter\":                   {\"42P02\"},\n\t\"undefined_object\":                      {\"42704\"},\n\t\"duplicate_column\":                      {\"42701\"},\n\t\"duplicate_cursor\":                      {\"42P03\"},\n\t\"duplicate_database\":                    {\"42P04\"},\n\t\"duplicate_function\":                    {\"42723\"},\n\t\"duplicate_prepared_statement\":          {\"42P05\"},\n\t\"duplicate_schema\":                      {\"42P06\"},\n\t\"duplicate_table\":                       {\"42P07\"},\n\t\"duplicate_alias\":                       {\"42712\"},\n\t\"duplicate_object\":                      {\"42710\"},\n\t\"ambiguous_column\":                      {\"42702\"},\n\t\"ambiguous_function\":                    {\"42725\"},\n\t\"ambiguous_parameter\":                   {\"42P08\"},\n\t\"ambiguous_alias\":                       {\"42P09\"},\n\t\"invalid_column_reference\":              {\"42P10\"},\n\t\"invalid_column_definition\":             {\"42611\"},\n\t\"invalid_cursor_definition\":             {\"42P11\"},\n\t\"invalid_database_definition\":           {\"42P12\"},\n\t\"invalid_function_definition\":           {\"42P13\"},\n\t\"invalid_prepared_statement_definition\": {\"42P14\"},\n\t\"invalid_schema_definition\":             {\"42P15\"},\n\t\"invalid_table_definition\":              {\"42P16\"},\n\t\"invalid_object_definition\":             {\"42P17\"},\n\n\t\"with_check_option_violation\": {\"44000\"},\n\n\t\"insufficient_resources\":       {\"53000\"},\n\t\"disk_full\":                    {\"53100\"},\n\t\"out_of_memory\":                {\"53200\"},\n\t\"too_many_connections\":         {\"53300\"},\n\t\"configuration_limit_exceeded\": {\"53400\"},\n\n\t\"program_limit_exceeded\": {\"54000\"},\n\t\"statement_too_complex\":  {\"54001\"},\n\t\"too_many_columns\":       {\"54011\"},\n\t\"too_many_arguments\":     {\"54023\"},\n\n\t\"object_not_in_prerequisite_state\": {\"55000\"},\n\t\"object_in_use\":                    {\"55006\"},\n\t\"cant_change_runtime_param\":        {\"55P02\"},\n\t\"lock_not_available\":               {\"55P03\"},\n\n\t\"operator_intervention\": {\"57000\"},\n\t\"query_canceled\":        {\"57014\"},\n\t\"admin_shutdown\":        {\"57P01\"},\n\t\"crash_shutdown\":        {\"57P02\"},\n\t\"cannot_connect_now\":    {\"57P03\"},\n\t\"database_dropped\":      {\"57P04\"},\n\n\t\"system_error\":   {\"58000\"},\n\t\"io_error\":       {\"58030\"},\n\t\"undefined_file\": {\"58P01\"},\n\t\"duplicate_file\": {\"58P02\"},\n\n\t\"config_file_error\": {\"F0000\"},\n\t\"lock_file_exists\":  {\"F0001\"},\n\n\t\"fdw_error\":                                  {\"HV000\"},\n\t\"fdw_column_name_not_found\":                  {\"HV005\"},\n\t\"fdw_dynamic_parameter_value_needed\":         {\"HV002\"},\n\t\"fdw_function_sequence_error\":                {\"HV010\"},\n\t\"fdw_inconsistent_descriptor_information\":    {\"HV021\"},\n\t\"fdw_invalid_attribute_value\":                {\"HV024\"},\n\t\"fdw_invalid_column_name\":                    {\"HV007\"},\n\t\"fdw_invalid_column_number\":                  {\"HV008\"},\n\t\"fdw_invalid_data_type\":                      {\"HV004\"},\n\t\"fdw_invalid_data_type_descriptors\":          {\"HV006\"},\n\t\"fdw_invalid_descriptor_field_identifier\":    {\"HV091\"},\n\t\"fdw_invalid_handle\":                         {\"HV00B\"},\n\t\"fdw_invalid_option_index\":                   {\"HV00C\"},\n\t\"fdw_invalid_option_name\":                    {\"HV00D\"},\n\t\"fdw_invalid_string_length_or_buffer_length\": {\"HV090\"},\n\t\"fdw_invalid_string_format\":                  {\"HV00A\"},\n\t\"fdw_invalid_use_of_null_pointer\":            {\"HV009\"},\n\t\"fdw_too_many_handles\":                       {\"HV014\"},\n\t\"fdw_out_of_memory\":                          {\"HV001\"},\n\t\"fdw_no_schemas\":                             {\"HV00P\"},\n\t\"fdw_option_name_not_found\":                  {\"HV00J\"},\n\t\"fdw_reply_handle\":                           {\"HV00K\"},\n\t\"fdw_schema_not_found\":                       {\"HV00Q\"},\n\t\"fdw_table_not_found\":                        {\"HV00R\"},\n\t\"fdw_unable_to_create_execution\":             {\"HV00L\"},\n\t\"fdw_unable_to_create_reply\":                 {\"HV00M\"},\n\t\"fdw_unable_to_establish_connection\":         {\"HV00N\"},\n\n\t\"plpgsql_error\":   {\"P0000\"},\n\t\"raise_exception\": {\"P0001\"},\n\t\"no_data_found\":   {\"P0002\"},\n\t\"too_many_rows\":   {\"P0003\"},\n\t\"assert_failure\":  {\"P0004\"},\n\n\t\"internal_error\":  {\"XX000\"},\n\t\"data_corrupted\":  {\"XX001\"},\n\t\"index_corrupted\": {\"XX002\"},\n\n\t\"null_value_not_allowed\":             {\"22004\", \"39004\"},\n\t\"string_data_right_truncation\":       {\"01004\", \"22001\"},\n\t\"modifying_sql_data_not_permitted\":   {\"2F002\", \"38002\"},\n\t\"prohibited_sql_statement_attempted\": {\"2F003\", \"38003\"},\n\t\"reading_sql_data_not_permitted\":     {\"2F004\", \"38004\"},\n}\n```\nPLpgSQLConditionNameToCode maps from PG error condition names to error codes. Most of the condition names map to one code, but a few (moved to the bottom) map to two codes. This is used for PLpgSQL exception handling.\n\nPLpgSQLConditionNameToCode was generated using the generate\\_names.sh script, then manually edited.\n\n## Functions\n\n```go\nfunc IsValidPGCode(code string) bool\n```\nIsValidPGCode returns true if the given code is a valid error code. Note that this does not check if the code is one of the pre-defined error codes like \"Syntax\" or \"InvalidName\" - instead, it checks that the format of the code is valid. This is because it is possible for users to throw and catch arbitrary error codes in PLpgSQL routines.\n\n## Types\n\n```go\ntype Code struct {\n\t// contains filtered or unexported fields\n}\n```\nCode is a wrapper around a string to ensure that pgcodes are used in different pgerror functions by avoiding accidental string input.\n\n```go\nfunc MakeCode(s string) Code\n```\nMakeCode converts a string into a Code.\n\n```go\nfunc (c Code) String() string\n```\nString returns the underlying pgcode string.\n\n","path":"github.com/cockroachdb/cockroachdb-parser/pkg/sql/pgwire/pgcode","name":"pgcode","synopsis":"Package pgcode defines the PostgreSQL 5-character support codes used throughout the CockroachDB source tree.","isRedistributable":true}
