Actually, there's no need to use pg_strcasecmp for checking exception

names, because the name we got from the lexer is already downcased.
Just store the table in lower case and use strcmp ...
This commit is contained in:
Tom Lane 2004-08-02 17:03:48 +00:00
parent d529989149
commit 9aa30e7109
2 changed files with 180 additions and 180 deletions

View File

@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.113 2004/08/02 01:30:49 tgl Exp $
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.114 2004/08/02 17:03:45 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@ -806,7 +806,7 @@ exception_matches_conditions(ErrorData *edata, PLpgSQL_condition *cond)
* OTHERS matches everything *except* query-canceled;
* if you're foolish enough, you can match that explicitly.
*/
if (pg_strcasecmp(condname, "OTHERS") == 0)
if (strcmp(condname, "others") == 0)
{
if (edata->sqlerrcode == ERRCODE_QUERY_CANCELED)
return false;
@ -815,7 +815,7 @@ exception_matches_conditions(ErrorData *edata, PLpgSQL_condition *cond)
}
for (i = 0; exception_label_map[i].label != NULL; i++)
{
if (pg_strcasecmp(condname, exception_label_map[i].label) == 0)
if (strcmp(condname, exception_label_map[i].label) == 0)
{
int labelerrcode = exception_label_map[i].sqlerrstate;

View File

@ -9,185 +9,185 @@
*
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/pl/plpgsql/src/plerrcodes.h,v 1.2 2004/07/31 23:04:56 tgl Exp $
* $PostgreSQL: pgsql/src/pl/plpgsql/src/plerrcodes.h,v 1.3 2004/08/02 17:03:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/* Success and warnings can't be caught, so omit them from table */
{ "SQL_STATEMENT_NOT_YET_COMPLETE", ERRCODE_SQL_STATEMENT_NOT_YET_COMPLETE },
{ "CONNECTION_EXCEPTION", ERRCODE_CONNECTION_EXCEPTION },
{ "CONNECTION_DOES_NOT_EXIST", ERRCODE_CONNECTION_DOES_NOT_EXIST },
{ "CONNECTION_FAILURE", ERRCODE_CONNECTION_FAILURE },
{ "SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION", ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION },
{ "SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION", ERRCODE_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION },
{ "TRANSACTION_RESOLUTION_UNKNOWN", ERRCODE_TRANSACTION_RESOLUTION_UNKNOWN },
{ "PROTOCOL_VIOLATION", ERRCODE_PROTOCOL_VIOLATION },
{ "TRIGGERED_ACTION_EXCEPTION", ERRCODE_TRIGGERED_ACTION_EXCEPTION },
{ "FEATURE_NOT_SUPPORTED", ERRCODE_FEATURE_NOT_SUPPORTED },
{ "INVALID_TRANSACTION_INITIATION", ERRCODE_INVALID_TRANSACTION_INITIATION },
{ "LOCATOR_EXCEPTION", ERRCODE_LOCATOR_EXCEPTION },
{ "INVALID_LOCATOR_SPECIFICATION", ERRCODE_L_E_INVALID_SPECIFICATION },
{ "INVALID_GRANTOR", ERRCODE_INVALID_GRANTOR },
{ "INVALID_GRANT_OPERATION", ERRCODE_INVALID_GRANT_OPERATION },
{ "INVALID_ROLE_SPECIFICATION", ERRCODE_INVALID_ROLE_SPECIFICATION },
{ "CARDINALITY_VIOLATION", ERRCODE_CARDINALITY_VIOLATION },
{ "DATA_EXCEPTION", ERRCODE_DATA_EXCEPTION },
{ "ARRAY_ELEMENT_ERROR", ERRCODE_ARRAY_ELEMENT_ERROR },
{ "ARRAY_SUBSCRIPT_ERROR", ERRCODE_ARRAY_SUBSCRIPT_ERROR },
{ "CHARACTER_NOT_IN_REPERTOIRE", ERRCODE_CHARACTER_NOT_IN_REPERTOIRE },
{ "DATETIME_FIELD_OVERFLOW", ERRCODE_DATETIME_FIELD_OVERFLOW },
{ "DATETIME_VALUE_OUT_OF_RANGE", ERRCODE_DATETIME_VALUE_OUT_OF_RANGE },
{ "DIVISION_BY_ZERO", ERRCODE_DIVISION_BY_ZERO },
{ "ERROR_IN_ASSIGNMENT", ERRCODE_ERROR_IN_ASSIGNMENT },
{ "ESCAPE_CHARACTER_CONFLICT", ERRCODE_ESCAPE_CHARACTER_CONFLICT },
{ "INDICATOR_OVERFLOW", ERRCODE_INDICATOR_OVERFLOW },
{ "INTERVAL_FIELD_OVERFLOW", ERRCODE_INTERVAL_FIELD_OVERFLOW },
{ "INVALID_ARGUMENT_FOR_LOGARITHM", ERRCODE_INVALID_ARGUMENT_FOR_LOG },
{ "INVALID_ARGUMENT_FOR_POWER_FUNCTION", ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION },
{ "INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION", ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION },
{ "INVALID_CHARACTER_VALUE_FOR_CAST", ERRCODE_INVALID_CHARACTER_VALUE_FOR_CAST },
{ "INVALID_DATETIME_FORMAT", ERRCODE_INVALID_DATETIME_FORMAT },
{ "INVALID_ESCAPE_CHARACTER", ERRCODE_INVALID_ESCAPE_CHARACTER },
{ "INVALID_ESCAPE_OCTET", ERRCODE_INVALID_ESCAPE_OCTET },
{ "INVALID_ESCAPE_SEQUENCE", ERRCODE_INVALID_ESCAPE_SEQUENCE },
{ "INVALID_INDICATOR_PARAMETER_VALUE", ERRCODE_INVALID_INDICATOR_PARAMETER_VALUE },
{ "INVALID_LIMIT_VALUE", ERRCODE_INVALID_LIMIT_VALUE },
{ "INVALID_PARAMETER_VALUE", ERRCODE_INVALID_PARAMETER_VALUE },
{ "INVALID_REGULAR_EXPRESSION", ERRCODE_INVALID_REGULAR_EXPRESSION },
{ "INVALID_TIME_ZONE_DISPLACEMENT_VALUE", ERRCODE_INVALID_TIME_ZONE_DISPLACEMENT_VALUE },
{ "INVALID_USE_OF_ESCAPE_CHARACTER", ERRCODE_INVALID_USE_OF_ESCAPE_CHARACTER },
{ "MOST_SPECIFIC_TYPE_MISMATCH", ERRCODE_MOST_SPECIFIC_TYPE_MISMATCH },
{ "NULL_VALUE_NOT_ALLOWED", ERRCODE_NULL_VALUE_NOT_ALLOWED },
{ "NULL_VALUE_NO_INDICATOR_PARAMETER", ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER },
{ "NUMERIC_VALUE_OUT_OF_RANGE", ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE },
{ "STRING_DATA_LENGTH_MISMATCH", ERRCODE_STRING_DATA_LENGTH_MISMATCH },
{ "STRING_DATA_RIGHT_TRUNCATION", ERRCODE_STRING_DATA_RIGHT_TRUNCATION },
{ "SUBSTRING_ERROR", ERRCODE_SUBSTRING_ERROR },
{ "TRIM_ERROR", ERRCODE_TRIM_ERROR },
{ "UNTERMINATED_C_STRING", ERRCODE_UNTERMINATED_C_STRING },
{ "ZERO_LENGTH_CHARACTER_STRING", ERRCODE_ZERO_LENGTH_CHARACTER_STRING },
{ "FLOATING_POINT_EXCEPTION", ERRCODE_FLOATING_POINT_EXCEPTION },
{ "INVALID_TEXT_REPRESENTATION", ERRCODE_INVALID_TEXT_REPRESENTATION },
{ "INVALID_BINARY_REPRESENTATION", ERRCODE_INVALID_BINARY_REPRESENTATION },
{ "BAD_COPY_FILE_FORMAT", ERRCODE_BAD_COPY_FILE_FORMAT },
{ "UNTRANSLATABLE_CHARACTER", ERRCODE_UNTRANSLATABLE_CHARACTER },
{ "INTEGRITY_CONSTRAINT_VIOLATION", ERRCODE_INTEGRITY_CONSTRAINT_VIOLATION },
{ "RESTRICT_VIOLATION", ERRCODE_RESTRICT_VIOLATION },
{ "NOT_NULL_VIOLATION", ERRCODE_NOT_NULL_VIOLATION },
{ "FOREIGN_KEY_VIOLATION", ERRCODE_FOREIGN_KEY_VIOLATION },
{ "UNIQUE_VIOLATION", ERRCODE_UNIQUE_VIOLATION },
{ "CHECK_VIOLATION", ERRCODE_CHECK_VIOLATION },
{ "INVALID_CURSOR_STATE", ERRCODE_INVALID_CURSOR_STATE },
{ "INVALID_TRANSACTION_STATE", ERRCODE_INVALID_TRANSACTION_STATE },
{ "ACTIVE_SQL_TRANSACTION", ERRCODE_ACTIVE_SQL_TRANSACTION },
{ "BRANCH_TRANSACTION_ALREADY_ACTIVE", ERRCODE_BRANCH_TRANSACTION_ALREADY_ACTIVE },
{ "HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL", ERRCODE_HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL },
{ "INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION", ERRCODE_INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION },
{ "INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION", ERRCODE_INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION },
{ "NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION", ERRCODE_NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION },
{ "READ_ONLY_SQL_TRANSACTION", ERRCODE_READ_ONLY_SQL_TRANSACTION },
{ "SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED", ERRCODE_SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED },
{ "NO_ACTIVE_SQL_TRANSACTION", ERRCODE_NO_ACTIVE_SQL_TRANSACTION },
{ "IN_FAILED_SQL_TRANSACTION", ERRCODE_IN_FAILED_SQL_TRANSACTION },
{ "INVALID_SQL_STATEMENT_NAME", ERRCODE_INVALID_SQL_STATEMENT_NAME },
{ "TRIGGERED_DATA_CHANGE_VIOLATION", ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION },
{ "INVALID_AUTHORIZATION_SPECIFICATION", ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION },
{ "DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST", ERRCODE_DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST },
{ "DEPENDENT_OBJECTS_STILL_EXIST", ERRCODE_DEPENDENT_OBJECTS_STILL_EXIST },
{ "INVALID_TRANSACTION_TERMINATION", ERRCODE_INVALID_TRANSACTION_TERMINATION },
{ "SQL_ROUTINE_EXCEPTION", ERRCODE_SQL_ROUTINE_EXCEPTION },
{ "FUNCTION_EXECUTED_NO_RETURN_STATEMENT", ERRCODE_S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT },
{ "MODIFYING_SQL_DATA_NOT_PERMITTED", ERRCODE_S_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED },
{ "PROHIBITED_SQL_STATEMENT_ATTEMPTED", ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED },
{ "READING_SQL_DATA_NOT_PERMITTED", ERRCODE_S_R_E_READING_SQL_DATA_NOT_PERMITTED },
{ "INVALID_CURSOR_NAME", ERRCODE_INVALID_CURSOR_NAME },
{ "EXTERNAL_ROUTINE_EXCEPTION", ERRCODE_EXTERNAL_ROUTINE_EXCEPTION },
{ "CONTAINING_SQL_NOT_PERMITTED", ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED },
{ "MODIFYING_SQL_DATA_NOT_PERMITTED", ERRCODE_E_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED },
{ "PROHIBITED_SQL_STATEMENT_ATTEMPTED", ERRCODE_E_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED },
{ "READING_SQL_DATA_NOT_PERMITTED", ERRCODE_E_R_E_READING_SQL_DATA_NOT_PERMITTED },
{ "EXTERNAL_ROUTINE_INVOCATION_EXCEPTION", ERRCODE_EXTERNAL_ROUTINE_INVOCATION_EXCEPTION },
{ "INVALID_SQLSTATE_RETURNED", ERRCODE_E_R_I_E_INVALID_SQLSTATE_RETURNED },
{ "NULL_VALUE_NOT_ALLOWED", ERRCODE_E_R_I_E_NULL_VALUE_NOT_ALLOWED },
{ "TRIGGER_PROTOCOL_VIOLATED", ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED },
{ "SRF_PROTOCOL_VIOLATED", ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED },
{ "SAVEPOINT_EXCEPTION", ERRCODE_SAVEPOINT_EXCEPTION },
{ "INVALID_SAVEPOINT_SPECIFICATION", ERRCODE_S_E_INVALID_SPECIFICATION },
{ "INVALID_CATALOG_NAME", ERRCODE_INVALID_CATALOG_NAME },
{ "INVALID_SCHEMA_NAME", ERRCODE_INVALID_SCHEMA_NAME },
{ "TRANSACTION_ROLLBACK", ERRCODE_TRANSACTION_ROLLBACK },
{ "TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION", ERRCODE_T_R_INTEGRITY_CONSTRAINT_VIOLATION },
{ "SERIALIZATION_FAILURE", ERRCODE_T_R_SERIALIZATION_FAILURE },
{ "STATEMENT_COMPLETION_UNKNOWN", ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN },
{ "DEADLOCK_DETECTED", ERRCODE_T_R_DEADLOCK_DETECTED },
{ "SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION", ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION },
{ "SYNTAX_ERROR", ERRCODE_SYNTAX_ERROR },
{ "INSUFFICIENT_PRIVILEGE", ERRCODE_INSUFFICIENT_PRIVILEGE },
{ "CANNOT_COERCE", ERRCODE_CANNOT_COERCE },
{ "GROUPING_ERROR", ERRCODE_GROUPING_ERROR },
{ "INVALID_FOREIGN_KEY", ERRCODE_INVALID_FOREIGN_KEY },
{ "INVALID_NAME", ERRCODE_INVALID_NAME },
{ "NAME_TOO_LONG", ERRCODE_NAME_TOO_LONG },
{ "RESERVED_NAME", ERRCODE_RESERVED_NAME },
{ "DATATYPE_MISMATCH", ERRCODE_DATATYPE_MISMATCH },
{ "INDETERMINATE_DATATYPE", ERRCODE_INDETERMINATE_DATATYPE },
{ "WRONG_OBJECT_TYPE", ERRCODE_WRONG_OBJECT_TYPE },
{ "UNDEFINED_COLUMN", ERRCODE_UNDEFINED_COLUMN },
{ "UNDEFINED_CURSOR", ERRCODE_UNDEFINED_CURSOR },
{ "UNDEFINED_DATABASE", ERRCODE_UNDEFINED_DATABASE },
{ "UNDEFINED_FUNCTION", ERRCODE_UNDEFINED_FUNCTION },
{ "UNDEFINED_PSTATEMENT", ERRCODE_UNDEFINED_PSTATEMENT },
{ "UNDEFINED_SCHEMA", ERRCODE_UNDEFINED_SCHEMA },
{ "UNDEFINED_TABLE", ERRCODE_UNDEFINED_TABLE },
{ "UNDEFINED_PARAMETER", ERRCODE_UNDEFINED_PARAMETER },
{ "UNDEFINED_OBJECT", ERRCODE_UNDEFINED_OBJECT },
{ "DUPLICATE_COLUMN", ERRCODE_DUPLICATE_COLUMN },
{ "DUPLICATE_CURSOR", ERRCODE_DUPLICATE_CURSOR },
{ "DUPLICATE_DATABASE", ERRCODE_DUPLICATE_DATABASE },
{ "DUPLICATE_FUNCTION", ERRCODE_DUPLICATE_FUNCTION },
{ "DUPLICATE_PREPARED_STATEMENT", ERRCODE_DUPLICATE_PSTATEMENT },
{ "DUPLICATE_SCHEMA", ERRCODE_DUPLICATE_SCHEMA },
{ "DUPLICATE_TABLE", ERRCODE_DUPLICATE_TABLE },
{ "DUPLICATE_ALIAS", ERRCODE_DUPLICATE_ALIAS },
{ "DUPLICATE_OBJECT", ERRCODE_DUPLICATE_OBJECT },
{ "AMBIGUOUS_COLUMN", ERRCODE_AMBIGUOUS_COLUMN },
{ "AMBIGUOUS_FUNCTION", ERRCODE_AMBIGUOUS_FUNCTION },
{ "AMBIGUOUS_PARAMETER", ERRCODE_AMBIGUOUS_PARAMETER },
{ "AMBIGUOUS_ALIAS", ERRCODE_AMBIGUOUS_ALIAS },
{ "INVALID_COLUMN_REFERENCE", ERRCODE_INVALID_COLUMN_REFERENCE },
{ "INVALID_COLUMN_DEFINITION", ERRCODE_INVALID_COLUMN_DEFINITION },
{ "INVALID_CURSOR_DEFINITION", ERRCODE_INVALID_CURSOR_DEFINITION },
{ "INVALID_DATABASE_DEFINITION", ERRCODE_INVALID_DATABASE_DEFINITION },
{ "INVALID_FUNCTION_DEFINITION", ERRCODE_INVALID_FUNCTION_DEFINITION },
{ "INVALID_PREPARED_STATEMENT_DEFINITION", ERRCODE_INVALID_PSTATEMENT_DEFINITION },
{ "INVALID_SCHEMA_DEFINITION", ERRCODE_INVALID_SCHEMA_DEFINITION },
{ "INVALID_TABLE_DEFINITION", ERRCODE_INVALID_TABLE_DEFINITION },
{ "INVALID_OBJECT_DEFINITION", ERRCODE_INVALID_OBJECT_DEFINITION },
{ "WITH_CHECK_OPTION_VIOLATION", ERRCODE_WITH_CHECK_OPTION_VIOLATION },
{ "INSUFFICIENT_RESOURCES", ERRCODE_INSUFFICIENT_RESOURCES },
{ "DISK_FULL", ERRCODE_DISK_FULL },
{ "OUT_OF_MEMORY", ERRCODE_OUT_OF_MEMORY },
{ "TOO_MANY_CONNECTIONS", ERRCODE_TOO_MANY_CONNECTIONS },
{ "PROGRAM_LIMIT_EXCEEDED", ERRCODE_PROGRAM_LIMIT_EXCEEDED },
{ "STATEMENT_TOO_COMPLEX", ERRCODE_STATEMENT_TOO_COMPLEX },
{ "TOO_MANY_COLUMNS", ERRCODE_TOO_MANY_COLUMNS },
{ "TOO_MANY_ARGUMENTS", ERRCODE_TOO_MANY_ARGUMENTS },
{ "OBJECT_NOT_IN_PREREQUISITE_STATE", ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE },
{ "OBJECT_IN_USE", ERRCODE_OBJECT_IN_USE },
{ "CANT_CHANGE_RUNTIME_PARAM", ERRCODE_CANT_CHANGE_RUNTIME_PARAM },
{ "OPERATOR_INTERVENTION", ERRCODE_OPERATOR_INTERVENTION },
{ "QUERY_CANCELED", ERRCODE_QUERY_CANCELED },
{ "ADMIN_SHUTDOWN", ERRCODE_ADMIN_SHUTDOWN },
{ "CRASH_SHUTDOWN", ERRCODE_CRASH_SHUTDOWN },
{ "CANNOT_CONNECT_NOW", ERRCODE_CANNOT_CONNECT_NOW },
{ "IO_ERROR", ERRCODE_IO_ERROR },
{ "UNDEFINED_FILE", ERRCODE_UNDEFINED_FILE },
{ "DUPLICATE_FILE", ERRCODE_DUPLICATE_FILE },
{ "CONFIG_FILE_ERROR", ERRCODE_CONFIG_FILE_ERROR },
{ "LOCK_FILE_EXISTS", ERRCODE_LOCK_FILE_EXISTS },
{ "PLPGSQL_ERROR", ERRCODE_PLPGSQL_ERROR },
{ "RAISE_EXCEPTION", ERRCODE_RAISE_EXCEPTION },
{ "INTERNAL_ERROR", ERRCODE_INTERNAL_ERROR },
{ "DATA_CORRUPTED", ERRCODE_DATA_CORRUPTED },
{ "INDEX_CORRUPTED", ERRCODE_INDEX_CORRUPTED },
{ "sql_statement_not_yet_complete", ERRCODE_SQL_STATEMENT_NOT_YET_COMPLETE },
{ "connection_exception", ERRCODE_CONNECTION_EXCEPTION },
{ "connection_does_not_exist", ERRCODE_CONNECTION_DOES_NOT_EXIST },
{ "connection_failure", ERRCODE_CONNECTION_FAILURE },
{ "sqlclient_unable_to_establish_sqlconnection", ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION },
{ "sqlserver_rejected_establishment_of_sqlconnection", ERRCODE_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION },
{ "transaction_resolution_unknown", ERRCODE_TRANSACTION_RESOLUTION_UNKNOWN },
{ "protocol_violation", ERRCODE_PROTOCOL_VIOLATION },
{ "triggered_action_exception", ERRCODE_TRIGGERED_ACTION_EXCEPTION },
{ "feature_not_supported", ERRCODE_FEATURE_NOT_SUPPORTED },
{ "invalid_transaction_initiation", ERRCODE_INVALID_TRANSACTION_INITIATION },
{ "locator_exception", ERRCODE_LOCATOR_EXCEPTION },
{ "invalid_locator_specification", ERRCODE_L_E_INVALID_SPECIFICATION },
{ "invalid_grantor", ERRCODE_INVALID_GRANTOR },
{ "invalid_grant_operation", ERRCODE_INVALID_GRANT_OPERATION },
{ "invalid_role_specification", ERRCODE_INVALID_ROLE_SPECIFICATION },
{ "cardinality_violation", ERRCODE_CARDINALITY_VIOLATION },
{ "data_exception", ERRCODE_DATA_EXCEPTION },
{ "array_element_error", ERRCODE_ARRAY_ELEMENT_ERROR },
{ "array_subscript_error", ERRCODE_ARRAY_SUBSCRIPT_ERROR },
{ "character_not_in_repertoire", ERRCODE_CHARACTER_NOT_IN_REPERTOIRE },
{ "datetime_field_overflow", ERRCODE_DATETIME_FIELD_OVERFLOW },
{ "datetime_value_out_of_range", ERRCODE_DATETIME_VALUE_OUT_OF_RANGE },
{ "division_by_zero", ERRCODE_DIVISION_BY_ZERO },
{ "error_in_assignment", ERRCODE_ERROR_IN_ASSIGNMENT },
{ "escape_character_conflict", ERRCODE_ESCAPE_CHARACTER_CONFLICT },
{ "indicator_overflow", ERRCODE_INDICATOR_OVERFLOW },
{ "interval_field_overflow", ERRCODE_INTERVAL_FIELD_OVERFLOW },
{ "invalid_argument_for_logarithm", ERRCODE_INVALID_ARGUMENT_FOR_LOG },
{ "invalid_argument_for_power_function", ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION },
{ "invalid_argument_for_width_bucket_function", ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION },
{ "invalid_character_value_for_cast", ERRCODE_INVALID_CHARACTER_VALUE_FOR_CAST },
{ "invalid_datetime_format", ERRCODE_INVALID_DATETIME_FORMAT },
{ "invalid_escape_character", ERRCODE_INVALID_ESCAPE_CHARACTER },
{ "invalid_escape_octet", ERRCODE_INVALID_ESCAPE_OCTET },
{ "invalid_escape_sequence", ERRCODE_INVALID_ESCAPE_SEQUENCE },
{ "invalid_indicator_parameter_value", ERRCODE_INVALID_INDICATOR_PARAMETER_VALUE },
{ "invalid_limit_value", ERRCODE_INVALID_LIMIT_VALUE },
{ "invalid_parameter_value", ERRCODE_INVALID_PARAMETER_VALUE },
{ "invalid_regular_expression", ERRCODE_INVALID_REGULAR_EXPRESSION },
{ "invalid_time_zone_displacement_value", ERRCODE_INVALID_TIME_ZONE_DISPLACEMENT_VALUE },
{ "invalid_use_of_escape_character", ERRCODE_INVALID_USE_OF_ESCAPE_CHARACTER },
{ "most_specific_type_mismatch", ERRCODE_MOST_SPECIFIC_TYPE_MISMATCH },
{ "null_value_not_allowed", ERRCODE_NULL_VALUE_NOT_ALLOWED },
{ "null_value_no_indicator_parameter", ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER },
{ "numeric_value_out_of_range", ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE },
{ "string_data_length_mismatch", ERRCODE_STRING_DATA_LENGTH_MISMATCH },
{ "string_data_right_truncation", ERRCODE_STRING_DATA_RIGHT_TRUNCATION },
{ "substring_error", ERRCODE_SUBSTRING_ERROR },
{ "trim_error", ERRCODE_TRIM_ERROR },
{ "unterminated_c_string", ERRCODE_UNTERMINATED_C_STRING },
{ "zero_length_character_string", ERRCODE_ZERO_LENGTH_CHARACTER_STRING },
{ "floating_point_exception", ERRCODE_FLOATING_POINT_EXCEPTION },
{ "invalid_text_representation", ERRCODE_INVALID_TEXT_REPRESENTATION },
{ "invalid_binary_representation", ERRCODE_INVALID_BINARY_REPRESENTATION },
{ "bad_copy_file_format", ERRCODE_BAD_COPY_FILE_FORMAT },
{ "untranslatable_character", ERRCODE_UNTRANSLATABLE_CHARACTER },
{ "integrity_constraint_violation", ERRCODE_INTEGRITY_CONSTRAINT_VIOLATION },
{ "restrict_violation", ERRCODE_RESTRICT_VIOLATION },
{ "not_null_violation", ERRCODE_NOT_NULL_VIOLATION },
{ "foreign_key_violation", ERRCODE_FOREIGN_KEY_VIOLATION },
{ "unique_violation", ERRCODE_UNIQUE_VIOLATION },
{ "check_violation", ERRCODE_CHECK_VIOLATION },
{ "invalid_cursor_state", ERRCODE_INVALID_CURSOR_STATE },
{ "invalid_transaction_state", ERRCODE_INVALID_TRANSACTION_STATE },
{ "active_sql_transaction", ERRCODE_ACTIVE_SQL_TRANSACTION },
{ "branch_transaction_already_active", ERRCODE_BRANCH_TRANSACTION_ALREADY_ACTIVE },
{ "held_cursor_requires_same_isolation_level", ERRCODE_HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL },
{ "inappropriate_access_mode_for_branch_transaction", ERRCODE_INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION },
{ "inappropriate_isolation_level_for_branch_transaction", ERRCODE_INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION },
{ "no_active_sql_transaction_for_branch_transaction", ERRCODE_NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION },
{ "read_only_sql_transaction", ERRCODE_READ_ONLY_SQL_TRANSACTION },
{ "schema_and_data_statement_mixing_not_supported", ERRCODE_SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED },
{ "no_active_sql_transaction", ERRCODE_NO_ACTIVE_SQL_TRANSACTION },
{ "in_failed_sql_transaction", ERRCODE_IN_FAILED_SQL_TRANSACTION },
{ "invalid_sql_statement_name", ERRCODE_INVALID_SQL_STATEMENT_NAME },
{ "triggered_data_change_violation", ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION },
{ "invalid_authorization_specification", ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION },
{ "dependent_privilege_descriptors_still_exist", ERRCODE_DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST },
{ "dependent_objects_still_exist", ERRCODE_DEPENDENT_OBJECTS_STILL_EXIST },
{ "invalid_transaction_termination", ERRCODE_INVALID_TRANSACTION_TERMINATION },
{ "sql_routine_exception", ERRCODE_SQL_ROUTINE_EXCEPTION },
{ "function_executed_no_return_statement", ERRCODE_S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT },
{ "modifying_sql_data_not_permitted", ERRCODE_S_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED },
{ "prohibited_sql_statement_attempted", ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED },
{ "reading_sql_data_not_permitted", ERRCODE_S_R_E_READING_SQL_DATA_NOT_PERMITTED },
{ "invalid_cursor_name", ERRCODE_INVALID_CURSOR_NAME },
{ "external_routine_exception", ERRCODE_EXTERNAL_ROUTINE_EXCEPTION },
{ "containing_sql_not_permitted", ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED },
{ "modifying_sql_data_not_permitted", ERRCODE_E_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED },
{ "prohibited_sql_statement_attempted", ERRCODE_E_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED },
{ "reading_sql_data_not_permitted", ERRCODE_E_R_E_READING_SQL_DATA_NOT_PERMITTED },
{ "external_routine_invocation_exception", ERRCODE_EXTERNAL_ROUTINE_INVOCATION_EXCEPTION },
{ "invalid_sqlstate_returned", ERRCODE_E_R_I_E_INVALID_SQLSTATE_RETURNED },
{ "null_value_not_allowed", ERRCODE_E_R_I_E_NULL_VALUE_NOT_ALLOWED },
{ "trigger_protocol_violated", ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED },
{ "srf_protocol_violated", ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED },
{ "savepoint_exception", ERRCODE_SAVEPOINT_EXCEPTION },
{ "invalid_savepoint_specification", ERRCODE_S_E_INVALID_SPECIFICATION },
{ "invalid_catalog_name", ERRCODE_INVALID_CATALOG_NAME },
{ "invalid_schema_name", ERRCODE_INVALID_SCHEMA_NAME },
{ "transaction_rollback", ERRCODE_TRANSACTION_ROLLBACK },
{ "transaction_integrity_constraint_violation", ERRCODE_T_R_INTEGRITY_CONSTRAINT_VIOLATION },
{ "serialization_failure", ERRCODE_T_R_SERIALIZATION_FAILURE },
{ "statement_completion_unknown", ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN },
{ "deadlock_detected", ERRCODE_T_R_DEADLOCK_DETECTED },
{ "syntax_error_or_access_rule_violation", ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION },
{ "syntax_error", ERRCODE_SYNTAX_ERROR },
{ "insufficient_privilege", ERRCODE_INSUFFICIENT_PRIVILEGE },
{ "cannot_coerce", ERRCODE_CANNOT_COERCE },
{ "grouping_error", ERRCODE_GROUPING_ERROR },
{ "invalid_foreign_key", ERRCODE_INVALID_FOREIGN_KEY },
{ "invalid_name", ERRCODE_INVALID_NAME },
{ "name_too_long", ERRCODE_NAME_TOO_LONG },
{ "reserved_name", ERRCODE_RESERVED_NAME },
{ "datatype_mismatch", ERRCODE_DATATYPE_MISMATCH },
{ "indeterminate_datatype", ERRCODE_INDETERMINATE_DATATYPE },
{ "wrong_object_type", ERRCODE_WRONG_OBJECT_TYPE },
{ "undefined_column", ERRCODE_UNDEFINED_COLUMN },
{ "undefined_cursor", ERRCODE_UNDEFINED_CURSOR },
{ "undefined_database", ERRCODE_UNDEFINED_DATABASE },
{ "undefined_function", ERRCODE_UNDEFINED_FUNCTION },
{ "undefined_pstatement", ERRCODE_UNDEFINED_PSTATEMENT },
{ "undefined_schema", ERRCODE_UNDEFINED_SCHEMA },
{ "undefined_table", ERRCODE_UNDEFINED_TABLE },
{ "undefined_parameter", ERRCODE_UNDEFINED_PARAMETER },
{ "undefined_object", ERRCODE_UNDEFINED_OBJECT },
{ "duplicate_column", ERRCODE_DUPLICATE_COLUMN },
{ "duplicate_cursor", ERRCODE_DUPLICATE_CURSOR },
{ "duplicate_database", ERRCODE_DUPLICATE_DATABASE },
{ "duplicate_function", ERRCODE_DUPLICATE_FUNCTION },
{ "duplicate_prepared_statement", ERRCODE_DUPLICATE_PSTATEMENT },
{ "duplicate_schema", ERRCODE_DUPLICATE_SCHEMA },
{ "duplicate_table", ERRCODE_DUPLICATE_TABLE },
{ "duplicate_alias", ERRCODE_DUPLICATE_ALIAS },
{ "duplicate_object", ERRCODE_DUPLICATE_OBJECT },
{ "ambiguous_column", ERRCODE_AMBIGUOUS_COLUMN },
{ "ambiguous_function", ERRCODE_AMBIGUOUS_FUNCTION },
{ "ambiguous_parameter", ERRCODE_AMBIGUOUS_PARAMETER },
{ "ambiguous_alias", ERRCODE_AMBIGUOUS_ALIAS },
{ "invalid_column_reference", ERRCODE_INVALID_COLUMN_REFERENCE },
{ "invalid_column_definition", ERRCODE_INVALID_COLUMN_DEFINITION },
{ "invalid_cursor_definition", ERRCODE_INVALID_CURSOR_DEFINITION },
{ "invalid_database_definition", ERRCODE_INVALID_DATABASE_DEFINITION },
{ "invalid_function_definition", ERRCODE_INVALID_FUNCTION_DEFINITION },
{ "invalid_prepared_statement_definition", ERRCODE_INVALID_PSTATEMENT_DEFINITION },
{ "invalid_schema_definition", ERRCODE_INVALID_SCHEMA_DEFINITION },
{ "invalid_table_definition", ERRCODE_INVALID_TABLE_DEFINITION },
{ "invalid_object_definition", ERRCODE_INVALID_OBJECT_DEFINITION },
{ "with_check_option_violation", ERRCODE_WITH_CHECK_OPTION_VIOLATION },
{ "insufficient_resources", ERRCODE_INSUFFICIENT_RESOURCES },
{ "disk_full", ERRCODE_DISK_FULL },
{ "out_of_memory", ERRCODE_OUT_OF_MEMORY },
{ "too_many_connections", ERRCODE_TOO_MANY_CONNECTIONS },
{ "program_limit_exceeded", ERRCODE_PROGRAM_LIMIT_EXCEEDED },
{ "statement_too_complex", ERRCODE_STATEMENT_TOO_COMPLEX },
{ "too_many_columns", ERRCODE_TOO_MANY_COLUMNS },
{ "too_many_arguments", ERRCODE_TOO_MANY_ARGUMENTS },
{ "object_not_in_prerequisite_state", ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE },
{ "object_in_use", ERRCODE_OBJECT_IN_USE },
{ "cant_change_runtime_param", ERRCODE_CANT_CHANGE_RUNTIME_PARAM },
{ "operator_intervention", ERRCODE_OPERATOR_INTERVENTION },
{ "query_canceled", ERRCODE_QUERY_CANCELED },
{ "admin_shutdown", ERRCODE_ADMIN_SHUTDOWN },
{ "crash_shutdown", ERRCODE_CRASH_SHUTDOWN },
{ "cannot_connect_now", ERRCODE_CANNOT_CONNECT_NOW },
{ "io_error", ERRCODE_IO_ERROR },
{ "undefined_file", ERRCODE_UNDEFINED_FILE },
{ "duplicate_file", ERRCODE_DUPLICATE_FILE },
{ "config_file_error", ERRCODE_CONFIG_FILE_ERROR },
{ "lock_file_exists", ERRCODE_LOCK_FILE_EXISTS },
{ "plpgsql_error", ERRCODE_PLPGSQL_ERROR },
{ "raise_exception", ERRCODE_RAISE_EXCEPTION },
{ "internal_error", ERRCODE_INTERNAL_ERROR },
{ "data_corrupted", ERRCODE_DATA_CORRUPTED },
{ "index_corrupted", ERRCODE_INDEX_CORRUPTED },