# PostgresError.class.php

Go to the documentation of this file.

    00001 <?php
    00002 /***************************************************************************
    00003  *   Copyright (C) 2006-2009 by Konstantin V. Arkhipov                     *
    00004  *                                                                         *
    00005  *   This program is free software; you can redistribute it and/or modify  *
    00006  *   it under the terms of the GNU Lesser General Public License as        *
    00007  *   published by the Free Software Foundation; either version 3 of the    *
    00008  *   License, or (at your option) any later version.                       *
    00009  *                                                                         *
    00010  ***************************************************************************/
    00011
    00019     final class PostgresError extends Enumeration
    00020     {
    00021         // Class 00 - Successful Completion
    00022         const SUCCESSFUL_COMPLETION                                 = '00000';
    00023
    00024         // Class 01 - Warning
    00025         const WARNING                                               = '01000';
    00026         const DYNAMIC_RESULT_SETS_RETURNED                          = '0100C';
    00027         const IMPLICIT_ZERO_BIT_PADDING                             = '01008';
    00028         const NULL_VALUE_ELIMINATED_IN_SET_FUNCTION                 = '01003';
    00029         const PRIVILEGE_NOT_GRANTED                                 = '01007';
    00030         const PRIVILEGE_NOT_REVOKED                                 = '01006';
    00031
    00032         // name changed due to collision with 22001
    00033         const STRING_DATA_RIGHT_TRUNCATION_WARNING                  = '01004';
    00034         const DEPRECATED_FEATURE                                    = '01P01';
    00035
    00036         // Class 02 - No Data (this is also a warning class per the SQL standard)
    00037         const NO_DATA                                               = '02000';
    00038         const NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED            = '02001';
    00039
    00040         // Class 03 - SQL Statement Not Yet Complete
    00041         const SQL_STATEMENT_NOT_YET_COMPLETE                        = '03000';
    00042
    00043         // Class 08 - Connection Exception
    00044         const CONNECTION_EXCEPTION                                  = '08000';
    00045         const CONNECTION_DOES_NOT_EXIST                             = '08003';
    00046         const CONNECTION_FAILURE                                    = '08006';
    00047         const SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION           = '08001';
    00048         const SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION     = '08004';
    00049         const TRANSACTION_RESOLUTION_UNKNOWN                        = '08007';
    00050         const PROTOCOL_VIOLATION                                    = '08P01';
    00051
    00052         // Class 09 - Triggered Action Exception
    00053         const TRIGGERED_ACTION_EXCEPTION                            = '09000';
    00054
    00055         // Class 0A - Feature Not Supported
    00056         const FEATURE_NOT_SUPPORTED                                 = '0A000';
    00057
    00058         // Class 0B - Invalid Transaction Initiation
    00059         const INVALID_TRANSACTION_INITIATION                        = '0B000';
    00060
    00061         // Class 0F - Locator Exception
    00062         const LOCATOR_EXCEPTION                                     = '0F000';
    00063         const INVALID_LOCATOR_SPECIFICATION                         = '0F001';
    00064
    00065         // Class 0L - Invalid Grantor
    00066         const INVALID_GRANTOR                                       = '0L000';
    00067         const INVALID_GRANT_OPERATION                               = '0LP01';
    00068
    00069         // Class 0P - Invalid Role Specification
    00070         const INVALID_ROLE_SPECIFICATION                            = '0P000';
    00071
    00072         // Class 21 - Cardinality Violation
    00073         const CARDINALITY_VIOLATION                                 = '21000';
    00074
    00075         // Class 22 - Data Exception
    00076         const DATA_EXCEPTION                                        = '22000';
    00077         const ARRAY_SUBSCRIPT_ERROR                                 = '2202E';
    00078         const CHARACTER_NOT_IN_REPERTOIRE                           = '22021';
    00079         const DATETIME_FIELD_OVERFLOW                               = '22008';
    00080         const DIVISION_BY_ZERO                                      = '22012';
    00081         const ERROR_IN_ASSIGNMENT                                   = '22005';
    00082         const ESCAPE_CHARACTER_CONFLICT                             = '2200B';
    00083         const INDICATOR_OVERFLOW                                    = '22022';
    00084         const INTERVAL_FIELD_OVERFLOW                               = '22015';
    00085         const INVALID_ARGUMENT_FOR_LOGARITHM                        = '2201E';
    00086         const INVALID_ARGUMENT_FOR_POWER_FUNCTION                   = '2201F';
    00087         const INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION            = '2201G';
    00088         const INVALID_CHARACTER_VALUE_FOR_CAST                      = '22018';
    00089         const INVALID_DATETIME_FORMAT                               = '22007';
    00090         const INVALID_ESCAPE_CHARACTER                              = '22019';
    00091         const INVALID_ESCAPE_OCTET                                  = '2200D';
    00092         const INVALID_ESCAPE_SEQUENCE                               = '22025';
    00093         const NONSTANDARD_USE_OF_ESCAPE_CHARACTER                   = '22P06';
    00094         const INVALID_INDICATOR_PARAMETER_VALUE                     = '22010';
    00095         const INVALID_LIMIT_VALUE                                   = '22020';
    00096         const INVALID_PARAMETER_VALUE                               = '22023';
    00097         const INVALID_REGULAR_EXPRESSION                            = '2201B';
    00098         const INVALID_TIME_ZONE_DISPLACEMENT_VALUE                  = '22009';
    00099         const INVALID_USE_OF_ESCAPE_CHARACTER                       = '2200C';
    00100         const MOST_SPECIFIC_TYPE_MISMATCH                           = '2200G';
    00101         const NULL_VALUE_NOT_ALLOWED                                = '22004';
    00102         const NULL_VALUE_NO_INDICATOR_PARAMETER                     = '22002';
    00103         const NUMERIC_VALUE_OUT_OF_RANGE                            = '22003';
    00104         const STRING_DATA_LENGTH_MISMATCH                           = '22026';
    00105         const STRING_DATA_RIGHT_TRUNCATION                          = '22001';
    00106         const SUBSTRING_ERROR                                       = '22011';
    00107         const TRIM_ERROR                                            = '22027';
    00108         const UNTERMINATED_C_STRING                                 = '22024';
    00109         const ZERO_LENGTH_CHARACTER_STRING                          = '2200F';
    00110         const FLOATING_POINT_EXCEPTION                              = '22P01';
    00111         const INVALID_TEXT_REPRESENTATION                           = '22P02';
    00112         const INVALID_BINARY_REPRESENTATION                         = '22P03';
    00113         const BAD_COPY_FILE_FORMAT                                  = '22P04';
    00114         const UNTRANSLATABLE_CHARACTER                              = '22P05';
    00115
    00116         // Class 23 - Integrity Constraint Violation
    00117         const INTEGRITY_CONSTRAINT_VIOLATION                        = '23000';
    00118         const RESTRICT_VIOLATION                                    = '23001';
    00119         const NOT_NULL_VIOLATION                                    = '23502';
    00120         const FOREIGN_KEY_VIOLATION                                 = '23503';
    00121         const UNIQUE_VIOLATION                                      = '23505';
    00122         const CHECK_VIOLATION                                       = '23514';
    00123
    00124         // Class 24 - Invalid Cursor State
    00125         const INVALID_CURSOR_STATE                                  = '24000';
    00126
    00127         // Class 25 - Invalid Transaction State
    00128         const INVALID_TRANSACTION_STATE                             = '25000';
    00129         const ACTIVE_SQL_TRANSACTION                                = '25001';
    00130         const BRANCH_TRANSACTION_ALREADY_ACTIVE                     = '25002';
    00131         const HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL             = '25008';
    00132         const INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION      = '25003';
    00133         const INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION  = '25004';
    00134         const NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION      = '25005';
    00135         const READ_ONLY_SQL_TRANSACTION                             = '25006';
    00136         const SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED        = '25007';
    00137         const NO_ACTIVE_SQL_TRANSACTION                             = '25P01';
    00138         const IN_FAILED_SQL_TRANSACTION                             = '25P02';
    00139
    00140         // Class 26 - Invalid SQL Statement Name
    00141         const INVALID_SQL_STATEMENT_NAME                            = '26000';
    00142
    00143         // Class 27 - Triggered Data Change Violation
    00144         const TRIGGERED_DATA_CHANGE_VIOLATION                       = '27000';
    00145
    00146         // Class 28 - Invalid Authorization Specification
    00147         const INVALID_AUTHORIZATION_SPECIFICATION                   = '28000';
    00148
    00149         // Class 2B - Dependent Privilege Descriptors Still Exist
    00150         const DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST           = '2B000';
    00151         const DEPENDENT_OBJECTS_STILL_EXIST                         = '2BP01';
    00152
    00153         // Class 2D - Invalid Transaction Termination
    00154         const INVALID_TRANSACTION_TERMINATION                       = '2D000';
    00155
    00156         // Class 2F - SQL Routine Exception
    00157         const SQL_ROUTINE_EXCEPTION                                 = '2F000';
    00158         const FUNCTION_EXECUTED_NO_RETURN_STATEMENT                 = '2F005';
    00159         const MODIFYING_SQL_DATA_NOT_PERMITTED                      = '2F002';
    00160
    00161         // name changed due to collision with 38003
    00162         const PROHIBITED_SQL_STATEMENT_ATTEMPTED_EXCEPTION          = '2F003';
    00163
    00164         // name changed due to collision with 38004
    00165         const READING_SQL_DATA_NOT_PERMITTED_EXCEPTION              = '2F004';
    00166
    00167         // Class 34 - Invalid Cursor Name
    00168         const INVALID_CURSOR_NAME                                   = '34000';
    00169
    00170         // Class 38 - External Routine Exception
    00171         const EXTERNAL_ROUTINE_EXCEPTION                            = '38000';
    00172         const CONTAINING_SQL_NOT_PERMITTED                          = '38001';
    00173
    00174         // name changed due to collision with 2F002
    00175         const MODIFYING_SQL_DATA_NOT_PERMITTED_EXTERNAL             = '38002';
    00176         const PROHIBITED_SQL_STATEMENT_ATTEMPTED                    = '38003';
    00177         const READING_SQL_DATA_NOT_PERMITTED                        = '38004';
    00178
    00179         // Class 39 - External Routine Invocation Exception
    00180         const EXTERNAL_ROUTINE_INVOCATION_EXCEPTION                 = '39000';
    00181         const INVALID_SQLSTATE_RETURNED                             = '39001';
    00182
    00183         // name changed due to collision with 22004
    00184         const NULL_VALUE_NOT_ALLOWED_EXTERNAL                       = '39004';
    00185         const TRIGGER_PROTOCOL_VIOLATED                             = '39P01';
    00186         const SRF_PROTOCOL_VIOLATED                                 = '39P02';
    00187
    00188         // Class 3B - Savepoint Exception
    00189         const SAVEPOINT_EXCEPTION                                   = '3B000';
    00190         const INVALID_SAVEPOINT_SPECIFICATION                       = '3B001';
    00191
    00192         // Class 3D - Invalid Catalog Name
    00193         const INVALID_CATALOG_NAME                                  = '3D000';
    00194
    00195         // Class 3F - Invalid Schema Name
    00196         const INVALID_SCHEMA_NAME                                   = '3F000';
    00197
    00198         // Class 40 - Transaction Rollback
    00199         const TRANSACTION_ROLLBACK                                  = '40000';
    00200         const TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION            = '40002';
    00201         const SERIALIZATION_FAILURE                                 = '40001';
    00202         const STATEMENT_COMPLETION_UNKNOWN                          = '40003';
    00203         const DEADLOCK_DETECTED                                     = '40P01';
    00204
    00205         // Class 42 - Syntax Error or Access Rule Violation
    00206         const SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION                 = '42000';
    00207         const SYNTAX_ERROR                                          = '42601';
    00208         const INSUFFICIENT_PRIVILEGE                                = '42501';
    00209         const CANNOT_COERCE                                         = '42846';
    00210         const GROUPING_ERROR                                        = '42803';
    00211         const INVALID_FOREIGN_KEY                                   = '42830';
    00212         const INVALID_NAME                                          = '42602';
    00213         const NAME_TOO_LONG                                         = '42622';
    00214         const RESERVED_NAME                                         = '42939';
    00215         const DATATYPE_MISMATCH                                     = '42804';
    00216         const INDETERMINATE_DATATYPE                                = '42P18';
    00217         const WRONG_OBJECT_TYPE                                     = '42809';
    00218         const UNDEFINED_COLUMN                                      = '42703';
    00219         const UNDEFINED_FUNCTION                                    = '42883';
    00220         const UNDEFINED_TABLE                                       = '42P01';
    00221         const UNDEFINED_PARAMETER                                   = '42P02';
    00222         const UNDEFINED_OBJECT                                      = '42704';
    00223         const DUPLICATE_COLUMN                                      = '42701';
    00224         const DUPLICATE_CURSOR                                      = '42P03';
    00225         const DUPLICATE_DATABASE                                    = '42P04';
    00226         const DUPLICATE_FUNCTION                                    = '42723';
    00227         const DUPLICATE_PREPARED_STATEMENT                          = '42P05';
    00228         const DUPLICATE_SCHEMA                                      = '42P06';
    00229         const DUPLICATE_TABLE                                       = '42P07';
    00230         const DUPLICATE_ALIAS                                       = '42712';
    00231         const DUPLICATE_OBJECT                                      = '42710';
    00232         const AMBIGUOUS_COLUMN                                      = '42702';
    00233         const AMBIGUOUS_FUNCTION                                    = '42725';
    00234         const AMBIGUOUS_PARAMETER                                   = '42P08';
    00235         const AMBIGUOUS_ALIAS                                       = '42P09';
    00236         const INVALID_COLUMN_REFERENCE                              = '42P10';
    00237         const INVALID_COLUMN_DEFINITION                             = '42611';
    00238         const INVALID_CURSOR_DEFINITION                             = '42P11';
    00239         const INVALID_DATABASE_DEFINITION                           = '42P12';
    00240         const INVALID_FUNCTION_DEFINITION                           = '42P13';
    00241         const INVALID_PREPARED_STATEMENT_DEFINITION                 = '42P14';
    00242         const INVALID_SCHEMA_DEFINITION                             = '42P15';
    00243         const INVALID_TABLE_DEFINITION                              = '42P16';
    00244         const INVALID_OBJECT_DEFINITION                             = '42P17';
    00245
    00246         // Class 44 - WITH CHECK OPTION Violation
    00247         const WITH_CHECK_OPTION_VIOLATION                           = '44000';
    00248
    00249         // Class 53 - Insufficient Resources
    00250         const INSUFFICIENT_RESOURCES                                = '53000';
    00251         const DISK_FULL                                             = '53100';
    00252         const OUT_OF_MEMORY                                         = '53200';
    00253         const TOO_MANY_CONNECTIONS                                  = '53300';
    00254
    00255         // Class 54 - Program Limit Exceeded
    00256         const PROGRAM_LIMIT_EXCEEDED                                = '54000';
    00257         const STATEMENT_TOO_COMPLEX                                 = '54001';
    00258         const TOO_MANY_COLUMNS                                      = '54011';
    00259         const TOO_MANY_ARGUMENTS                                    = '54023';
    00260
    00261         // Class 55 - Object Not In Prerequisite State
    00262         const OBJECT_NOT_IN_PREREQUISITE_STATE                      = '55000';
    00263         const OBJECT_IN_USE                                         = '55006';
    00264         const CANT_CHANGE_RUNTIME_PARAM                             = '55P02';
    00265         const LOCK_NOT_AVAILABLE                                    = '55P03';
    00266
    00267         // Class 57 - Operator Intervention
    00268         const OPERATOR_INTERVENTION                                 = '57000';
    00269         const QUERY_CANCELED                                        = '57014';
    00270         const ADMIN_SHUTDOWN                                        = '57P01';
    00271         const CRASH_SHUTDOWN                                        = '57P02';
    00272         const CANNOT_CONNECT_NOW                                    = '57P03';
    00273
    00274         // Class 58 - System Error (errors external to PostgreSQL itself)
    00275         const IO_ERROR                                              = '58030';
    00276         const UNDEFINED_FILE                                        = '58P01';
    00277         const DUPLICATE_FILE                                        = '58P02';
    00278
    00279         // Class F0 - Configuration File Error
    00280         const CONFIG_FILE_ERROR                                     = 'F0000';
    00281         const LOCK_FILE_EXISTS                                      = 'F0001';
    00282
    00283         // Class P0 - PL/pgSQL Error
    00284         const PLPGSQL_ERROR                                         = 'P0000';
    00285         const RAISE_EXCEPTION                                       = 'P0001';
    00286
    00287         // Class XX - Internal Error
    00288         const INTERNAL_ERROR                                        = 'XX000';
    00289         const DATA_CORRUPTED                                        = 'XX001';
    00290         const INDEX_CORRUPTED                                       = 'XX002';
    00291
    00292         protected $names = array(
    00293             // Class 00 - Successful Completion
    00294             '00000' => 'SUCCESSFUL COMPLETION',
    00295
    00296             // Class 01 - Warning
    00297             '01000' => 'WARNING',
    00298             '0100C' => 'DYNAMIC RESULT SETS RETURNED',
    00299             '01008' => 'IMPLICIT ZERO BIT PADDING',
    00300             '01003' => 'NULL VALUE ELIMINATED IN SET FUNCTION',
    00301             '01007' => 'PRIVILEGE NOT GRANTED',
    00302             '01006' => 'PRIVILEGE NOT REVOKED',
    00303             '01004' => 'STRING DATA RIGHT TRUNCATION',
    00304             '01P01' => 'DEPRECATED FEATURE',
    00305
    00306             // Class 02 - No Data (this is also a warning class per the SQL standard)
    00307             '02000' => 'NO DATA',
    00308             '02001' => 'NO ADDITIONAL DYNAMIC RESULT SETS RETURNED',
    00309
    00310             // Class 03 - SQL Statement Not Yet Complete
    00311             '03000' => 'SQL STATEMENT NOT YET COMPLETE',
    00312
    00313             // Class 08 - Connection Exception
    00314             '08000' => 'CONNECTION EXCEPTION',
    00315             '08003' => 'CONNECTION DOES NOT EXIST',
    00316             '08006' => 'CONNECTION FAILURE',
    00317             '08001' => 'SQLCLIENT UNABLE TO ESTABLISH SQLCONNECTION',
    00318             '08004' => 'SQLSERVER REJECTED ESTABLISHMENT OF SQLCONNECTION',
    00319             '08007' => 'TRANSACTION RESOLUTION UNKNOWN',
    00320             '08P01' => 'PROTOCOL VIOLATION',
    00321
    00322             // Class 09 - Triggered Action Exception
    00323             '09000' => 'TRIGGERED ACTION EXCEPTION',
    00324
    00325             // Class 0A - Feature Not Supported
    00326             '0A000' => 'FEATURE NOT SUPPORTED',
    00327
    00328             // Class 0B - Invalid Transaction Initiation
    00329             '0B000' => 'INVALID TRANSACTION INITIATION',
    00330
    00331             // Class 0F - Locator Exception
    00332             '0F000' => 'LOCATOR EXCEPTION',
    00333             '0F001' => 'INVALID LOCATOR SPECIFICATION',
    00334
    00335             // Class 0L - Invalid Grantor
    00336             '0L000' => 'INVALID GRANTOR',
    00337             '0LP01' => 'INVALID GRANT OPERATION',
    00338
    00339             // Class 0P - Invalid Role Specification
    00340             '0P000' => 'INVALID ROLE SPECIFICATION',
    00341
    00342             // Class 21 - Cardinality Violation
    00343             '21000' => 'CARDINALITY VIOLATION',
    00344
    00345             // Class 22 - Data Exception
    00346             '22000' => 'DATA EXCEPTION',
    00347             '2202E' => 'ARRAY SUBSCRIPT ERROR',
    00348             '22021' => 'CHARACTER NOT IN REPERTOIRE',
    00349             '22008' => 'DATETIME FIELD OVERFLOW',
    00350             '22012' => 'DIVISION BY ZERO',
    00351             '22005' => 'ERROR IN ASSIGNMENT',
    00352             '2200B' => 'ESCAPE CHARACTER CONFLICT',
    00353             '22022' => 'INDICATOR OVERFLOW',
    00354             '22015' => 'INTERVAL FIELD OVERFLOW',
    00355             '2201E' => 'INVALID ARGUMENT FOR LOGARITHM',
    00356             '2201F' => 'INVALID ARGUMENT FOR POWER FUNCTION',
    00357             '2201G' => 'INVALID ARGUMENT FOR WIDTH BUCKET FUNCTION',
    00358             '22018' => 'INVALID CHARACTER VALUE FOR CAST',
    00359             '22007' => 'INVALID DATETIME FORMAT',
    00360             '22019' => 'INVALID ESCAPE CHARACTER',
    00361             '2200D' => 'INVALID ESCAPE OCTET',
    00362             '22025' => 'INVALID ESCAPE SEQUENCE',
    00363             '22P06' => 'NONSTANDARD USE OF ESCAPE CHARACTER',
    00364             '22010' => 'INVALID INDICATOR PARAMETER VALUE',
    00365             '22020' => 'INVALID LIMIT VALUE',
    00366             '22023' => 'INVALID PARAMETER VALUE',
    00367             '2201B' => 'INVALID REGULAR EXPRESSION',
    00368             '22009' => 'INVALID TIME ZONE DISPLACEMENT VALUE',
    00369             '2200C' => 'INVALID USE OF ESCAPE CHARACTER',
    00370             '2200G' => 'MOST SPECIFIC TYPE MISMATCH',
    00371             '22004' => 'NULL VALUE NOT ALLOWED',
    00372             '22002' => 'NULL VALUE NO INDICATOR PARAMETER',
    00373             '22003' => 'NUMERIC VALUE OUT OF RANGE',
    00374             '22026' => 'STRING DATA LENGTH MISMATCH',
    00375             '22001' => 'STRING DATA RIGHT TRUNCATION',
    00376             '22011' => 'SUBSTRING ERROR',
    00377             '22027' => 'TRIM ERROR',
    00378             '22024' => 'UNTERMINATED C STRING',
    00379             '2200F' => 'ZERO LENGTH CHARACTER STRING',
    00380             '22P01' => 'FLOATING POINT EXCEPTION',
    00381             '22P02' => 'INVALID TEXT REPRESENTATION',
    00382             '22P03' => 'INVALID BINARY REPRESENTATION',
    00383             '22P04' => 'BAD COPY FILE FORMAT',
    00384             '22P05' => 'UNTRANSLATABLE CHARACTER',
    00385
    00386             // Class 23 - Integrity Constraint Violation
    00387             '23000' => 'INTEGRITY CONSTRAINT VIOLATION',
    00388             '23001' => 'RESTRICT VIOLATION',
    00389             '23502' => 'NOT NULL VIOLATION',
    00390             '23503' => 'FOREIGN KEY VIOLATION',
    00391             '23505' => 'UNIQUE VIOLATION',
    00392             '23514' => 'CHECK VIOLATION',
    00393
    00394             // Class 24 - Invalid Cursor State
    00395             '24000' => 'INVALID CURSOR STATE',
    00396
    00397             // Class 25 - Invalid Transaction State
    00398             '25000' => 'INVALID TRANSACTION STATE',
    00399             '25001' => 'ACTIVE SQL TRANSACTION',
    00400             '25002' => 'BRANCH TRANSACTION ALREADY ACTIVE',
    00401             '25008' => 'HELD CURSOR REQUIRES SAME ISOLATION LEVEL',
    00402             '25003' => 'INAPPROPRIATE ACCESS MODE FOR BRANCH TRANSACTION',
    00403             '25004' => 'INAPPROPRIATE ISOLATION LEVEL FOR BRANCH TRANSACTION',
    00404             '25005' => 'NO ACTIVE SQL TRANSACTION FOR BRANCH TRANSACTION',
    00405             '25006' => 'READ ONLY SQL TRANSACTION',
    00406             '25007' => 'SCHEMA AND DATA STATEMENT MIXING NOT SUPPORTED',
    00407             '25P01' => 'NO ACTIVE SQL TRANSACTION',
    00408             '25P02' => 'IN FAILED SQL TRANSACTION',
    00409
    00410             // Class 26 - Invalid SQL Statement Name
    00411             '26000' => 'INVALID SQL STATEMENT NAME',
    00412
    00413             // Class 27 - Triggered Data Change Violation
    00414             '27000' => 'TRIGGERED DATA CHANGE VIOLATION',
    00415
    00416             // Class 28 - Invalid Authorization Specification
    00417             '28000' => 'INVALID AUTHORIZATION SPECIFICATION',
    00418
    00419             // Class 2B - Dependent Privilege Descriptors Still Exist
    00420             '2B000' => 'DEPENDENT PRIVILEGE DESCRIPTORS STILL EXIST',
    00421             '2BP01' => 'DEPENDENT OBJECTS STILL EXIST',
    00422
    00423             // Class 2D - Invalid Transaction Termination
    00424             '2D000' => 'INVALID TRANSACTION TERMINATION',
    00425
    00426             // Class 2F - SQL Routine Exception
    00427             '2F000' => 'SQL ROUTINE EXCEPTION',
    00428             '2F005' => 'FUNCTION EXECUTED NO RETURN STATEMENT',
    00429             '2F002' => 'MODIFYING SQL DATA NOT PERMITTED',
    00430             '2F003' => 'PROHIBITED SQL STATEMENT ATTEMPTED',
    00431             '2F004' => 'READING SQL DATA NOT PERMITTED',
    00432
    00433             // Class 34 - Invalid Cursor Name
    00434             '34000' => 'INVALID CURSOR NAME',
    00435
    00436             // Class 38 - External Routine Exception
    00437             '38000' => 'EXTERNAL ROUTINE EXCEPTION',
    00438             '38001' => 'CONTAINING SQL NOT PERMITTED',
    00439             '38002' => 'MODIFYING SQL DATA NOT PERMITTED',
    00440             '38003' => 'PROHIBITED SQL STATEMENT ATTEMPTED',
    00441             '38004' => 'READING SQL DATA NOT PERMITTED',
    00442
    00443             // Class 39 - External Routine Invocation Exception
    00444             '39000' => 'EXTERNAL ROUTINE INVOCATION EXCEPTION',
    00445             '39001' => 'INVALID SQLSTATE RETURNED',
    00446             '39004' => 'NULL VALUE NOT ALLOWED',
    00447             '39P01' => 'TRIGGER PROTOCOL VIOLATED',
    00448             '39P02' => 'SRF PROTOCOL VIOLATED',
    00449
    00450             // Class 3B - Savepoint Exception
    00451             '3B000' => 'SAVEPOINT EXCEPTION',
    00452             '3B001' => 'INVALID SAVEPOINT SPECIFICATION',
    00453
    00454             // Class 3D - Invalid Catalog Name
    00455             '3D000' => 'INVALID CATALOG NAME',
    00456
    00457             // Class 3F - Invalid Schema Name
    00458             '3F000' => 'INVALID SCHEMA NAME',
    00459
    00460             // Class 40 - Transaction Rollback
    00461             '40000' => 'TRANSACTION ROLLBACK',
    00462             '40002' => 'TRANSACTION INTEGRITY CONSTRAINT VIOLATION',
    00463             '40001' => 'SERIALIZATION FAILURE',
    00464             '40003' => 'STATEMENT COMPLETION UNKNOWN',
    00465             '40P01' => 'DEADLOCK DETECTED',
    00466
    00467             // Class 42 - Syntax Error or Access Rule Violation
    00468             '42000' => 'SYNTAX ERROR OR ACCESS RULE VIOLATION',
    00469             '42601' => 'SYNTAX ERROR',
    00470             '42501' => 'INSUFFICIENT PRIVILEGE',
    00471             '42846' => 'CANNOT COERCE',
    00472             '42803' => 'GROUPING ERROR',
    00473             '42830' => 'INVALID FOREIGN KEY',
    00474             '42602' => 'INVALID NAME',
    00475             '42622' => 'NAME TOO LONG',
    00476             '42939' => 'RESERVED NAME',
    00477             '42804' => 'DATATYPE MISMATCH',
    00478             '42P18' => 'INDETERMINATE DATATYPE',
    00479             '42809' => 'WRONG OBJECT TYPE',
    00480             '42703' => 'UNDEFINED COLUMN',
    00481             '42883' => 'UNDEFINED FUNCTION',
    00482             '42P01' => 'UNDEFINED TABLE',
    00483             '42P02' => 'UNDEFINED PARAMETER',
    00484             '42704' => 'UNDEFINED OBJECT',
    00485             '42701' => 'DUPLICATE COLUMN',
    00486             '42P03' => 'DUPLICATE CURSOR',
    00487             '42P04' => 'DUPLICATE DATABASE',
    00488             '42723' => 'DUPLICATE FUNCTION',
    00489             '42P05' => 'DUPLICATE PREPARED STATEMENT',
    00490             '42P06' => 'DUPLICATE SCHEMA',
    00491             '42P07' => 'DUPLICATE TABLE',
    00492             '42712' => 'DUPLICATE ALIAS',
    00493             '42710' => 'DUPLICATE OBJECT',
    00494             '42702' => 'AMBIGUOUS COLUMN',
    00495             '42725' => 'AMBIGUOUS FUNCTION',
    00496             '42P08' => 'AMBIGUOUS PARAMETER',
    00497             '42P09' => 'AMBIGUOUS ALIAS',
    00498             '42P10' => 'INVALID COLUMN REFERENCE',
    00499             '42611' => 'INVALID COLUMN DEFINITION',
    00500             '42P11' => 'INVALID CURSOR DEFINITION',
    00501             '42P12' => 'INVALID DATABASE DEFINITION',
    00502             '42P13' => 'INVALID FUNCTION DEFINITION',
    00503             '42P14' => 'INVALID PREPARED STATEMENT DEFINITION',
    00504             '42P15' => 'INVALID SCHEMA DEFINITION',
    00505             '42P16' => 'INVALID TABLE DEFINITION',
    00506             '42P17' => 'INVALID OBJECT DEFINITION',
    00507
    00508             // Class 44 - WITH CHECK OPTION Violation
    00509             '44000' => 'WITH CHECK OPTION VIOLATION',
    00510
    00511             // Class 53 - Insufficient Resources
    00512             '53000' => 'INSUFFICIENT RESOURCES',
    00513             '53100' => 'DISK FULL',
    00514             '53200' => 'OUT OF MEMORY',
    00515             '53300' => 'TOO MANY CONNECTIONS',
    00516
    00517             // Class 54 - Program Limit Exceeded
    00518             '54000' => 'PROGRAM LIMIT EXCEEDED',
    00519             '54001' => 'STATEMENT TOO COMPLEX',
    00520             '54011' => 'TOO MANY COLUMNS',
    00521             '54023' => 'TOO MANY ARGUMENTS',
    00522
    00523             // Class 55 - Object Not In Prerequisite State
    00524             '55000' => 'OBJECT NOT IN PREREQUISITE STATE',
    00525             '55006' => 'OBJECT IN USE',
    00526             '55P02' => 'CANT CHANGE RUNTIME PARAM',
    00527             '55P03' => 'LOCK NOT AVAILABLE',
    00528
    00529             // Class 57 - Operator Intervention
    00530             '57000' => 'OPERATOR INTERVENTION',
    00531             '57014' => 'QUERY CANCELED',
    00532             '57P01' => 'ADMIN SHUTDOWN',
    00533             '57P02' => 'CRASH SHUTDOWN',
    00534             '57P03' => 'CANNOT CONNECT NOW',
    00535
    00536             // Class 58 - System Error (errors external to PostgreSQL itself)
    00537             '58030' => 'IO ERROR',
    00538             '58P01' => 'UNDEFINED FILE',
    00539             '58P02' => 'DUPLICATE FILE',
    00540
    00541             // Class F0 - Configuration File Error
    00542             'F0000' => 'CONFIG FILE ERROR',
    00543             'F0001' => 'LOCK FILE EXISTS',
    00544
    00545             // Class P0 - PL/pgSQL Error
    00546             'P0000' => 'PLPGSQL ERROR',
    00547             'P0001' => 'RAISE EXCEPTION',
    00548
    00549             // Class XX - Internal Error
    00550             'XX000' => 'INTERNAL ERROR',
    00551             'XX001' => 'DATA CORRUPTED',
    00552             'XX002' => 'INDEX CORRUPTED'
    00553         );
    00554
    00555         public static function getAnyId()
    00556         {
    00557             return self::SUCCESSFUL_COMPLETION;
    00558         }
    00559     }
    00560 ?>