]> granicus.if.org Git - php/commitdiff
Add sqlstates defined in PostgreSQL documentation.
authorEdin Kadribasic <edink@php.net>
Fri, 1 Jul 2005 23:32:39 +0000 (23:32 +0000)
committerEdin Kadribasic <edink@php.net>
Fri, 1 Jul 2005 23:32:39 +0000 (23:32 +0000)
Source: http://www.postgresql.org/docs/8.0/static/errcodes-appendix.html

ext/pdo/pdo_sqlstate.c

index 9796dbfb0766d9eddec414955293eb9740100f53..07f2589aa4f023c9359a95232356bb3a456eba82 100644 (file)
@@ -36,13 +36,17 @@ struct pdo_sqlstate_info {
 static HashTable err_hash;
 
 static struct pdo_sqlstate_info err_initializer[] = {
-       { "00000",  "No error" },
+       { "00000",      "No error" },
+       { "01000",      "Warning" },
        { "01001",      "Cursor operation conflict" },
        { "01002",      "Disconnect error" },
        { "01003",      "NULL value eliminated in set function" },
        { "01004",      "String data, right truncated" },
        { "01006",      "Privilege not revoked" },
        { "01007",      "Privilege not granted" },
+       { "01008",      "Implicit zero bit padding" },
+       { "0100C",      "Dynamic result sets returned" },
+       { "01P01",      "Deprecated feature" },
        { "01S00",      "Invalid connection string attribute" },
        { "01S01",      "Error in row" },
        { "01S02",      "Option value changed" },
@@ -50,44 +54,163 @@ static struct pdo_sqlstate_info err_initializer[] = {
        { "01S07",      "Fractional truncation" },
        { "01S08",      "Error saving File DSN" },
        { "01S09",      "Invalid keyword" },
+       { "02000",      "No data" },
+       { "02001",      "No additional dynamic result sets returned" },
+       { "03000",      "Sql statement not yet complete" },
        { "07002",      "COUNT field incorrect" },
        { "07005",      "Prepared statement not a cursor-specification" },
        { "07006",      "Restricted data type attribute violation" },
        { "07009",      "Invalid descriptor index" },
        { "07S01",      "Invalid use of default parameter" },
+       { "08000",      "Connection exception" },
        { "08001",      "Client unable to establish connection" },
        { "08002",      "Connection name in use" },
        { "08003",      "Connection does not exist" },
        { "08004",      "Server rejected the connection" },
+       { "08006",      "Connection failure" },
        { "08007",      "Connection failure during transaction" },
        { "08S01",      "Communication link failure" },
+       { "09000",      "Triggered action exception" },
+       { "0A000",      "Feature not supported" },
+       { "0B000",      "Invalid transaction initiation" },
+       { "0F000",      "Locator exception" },
+       { "0F001",      "Invalid locator specification" },
+       { "0L000",      "Invalid grantor" },
+       { "0LP01",      "Invalid grant operation" },
+       { "0P000",      "Invalid role specification" },
+       { "21000",      "Cardinality violation" },
        { "21S01",      "Insert value list does not match column list" },
        { "21S02",      "Degree of derived table does not match column list" },
+       { "22000",      "Data exception" },
        { "22001",      "String data, right truncated" },
        { "22002",      "Indicator variable required but not supplied" },
        { "22003",      "Numeric value out of range" },
+       { "22004",      "Null value not allowed" },
+       { "22005",      "Error in assignment" },
        { "22007",      "Invalid datetime format" },
        { "22008",      "Datetime field overflow" },
+       { "22009",      "Invalid time zone displacement value" },
+       { "2200B",      "Escape character conflict" },
+       { "2200C",      "Invalid use of escape character" },
+       { "2200D",      "Invalid escape octet" },
+       { "2200F",      "Zero length character string" },
+       { "2200G",      "Most specific type mismatch" },
+       { "22010",      "Invalid indicator parameter value" },
+       { "22011",      "Substring error" },
        { "22012",      "Division by zero" },
        { "22015",      "Interval field overflow" },
        { "22018",      "Invalid character value for cast specification" },
        { "22019",      "Invalid escape character" },
+       { "2201B",      "Invalid regular expression" },
+       { "2201E",      "Invalid argument for logarithm" },
+       { "2201F",      "Invalid argument for power function" },
+       { "2201G",      "Invalid argument for width bucket function" },
+       { "22020",      "Invalid limit value" },
+       { "22021",      "Character not in repertoire" },
+       { "22022",      "Indicator overflow" },
+       { "22023",      "Invalid parameter value" },
+       { "22024",      "Unterminated c string" },
        { "22025",      "Invalid escape sequence" },
        { "22026",      "String data, length mismatch" },
+       { "22027",      "Trim error" },
+       { "2202E",      "Array subscript error" },
+       { "22P01",      "Floating point exception" },
+       { "22P02",      "Invalid text representation" },
+       { "22P03",      "Invalid binary representation" },
+       { "22P04",      "Bad copy file format" },
+       { "22P05",      "Untranslatable character" },
        { "23000",      "Integrity constraint violation" },
+       { "23001",      "Restrict violation" },
+       { "23502",      "Not null violation" },
+       { "23503",      "Foreign key violation" },
+       { "23505",      "Unique violation" },
+       { "23514",      "Check violation" },
        { "24000",      "Invalid cursor state" },
        { "25000",      "Invalid transaction state" },
+       { "25001",      "Active sql transaction" },
+       { "25002",      "Branch transaction already active" },
+       { "25003",      "Inappropriate access mode for branch transaction" },
+       { "25004",      "Inappropriate isolation level for branch transaction" },
+       { "25005",      "No active sql transaction for branch transaction" },
+       { "25006",      "Read only sql transaction" },
+       { "25007",      "Schema and data statement mixing not supported" },
+       { "25008",      "Held cursor requires same isolation level" },
+       { "25P01",      "No active sql transaction" },
+       { "25P02",      "In failed sql transaction" },
        { "25S01",      "Transaction state" },
        { "25S02",      "Transaction is still active" },
        { "25S03",      "Transaction is rolled back" },
+       { "26000",      "Invalid sql statement name" },
+       { "27000",      "Triggered data change violation" },
        { "28000",      "Invalid authorization specification" },
+       { "2B000",      "Dependent privilege descriptors still exist" },
+       { "2BP01",      "Dependent objects still exist" },
+       { "2D000",      "Invalid transaction termination" },
+       { "2F000",      "Sql routine exception" },
+       { "2F002",      "Modifying sql data not permitted" },
+       { "2F003",      "Prohibited sql statement attempted" },
+       { "2F004",      "Reading sql data not permitted" },
+       { "2F005",      "Function executed no return statement" },
        { "34000",      "Invalid cursor name" },
+       { "38000",      "External routine exception" },
+       { "38001",      "Containing sql not permitted" },
+       { "38002",      "Modifying sql data not permitted" },
+       { "38003",      "Prohibited sql statement attempted" },
+       { "38004",      "Reading sql data not permitted" },
+       { "39000",      "External routine invocation exception" },
+       { "39001",      "Invalid sqlstate returned" },
+       { "39004",      "Null value not allowed" },
+       { "39P01",      "Trigger protocol violated" },
+       { "39P02",      "Srf protocol violated" },
+       { "3B000",      "Savepoint exception" },
+       { "3B001",      "Invalid savepoint specification" },
        { "3C000",      "Duplicate cursor name" },
        { "3D000",      "Invalid catalog name" },
        { "3F000",      "Invalid schema name" },
+       { "40000",      "Transaction rollback" },
        { "40001",      "Serialization failure" },
+       { "40002",      "Transaction integrity constraint violation" },
        { "40003",      "Statement completion unknown" },
+       { "40P01",      "Deadlock detected" },
        { "42000",      "Syntax error or access violation" },
+       { "42501",      "Insufficient privilege" },
+       { "42601",      "Syntax error" },
+       { "42602",      "Invalid name" },
+       { "42611",      "Invalid column definition" },
+       { "42622",      "Name too long" },
+       { "42701",      "Duplicate column" },
+       { "42702",      "Ambiguous column" },
+       { "42703",      "Undefined column" },
+       { "42704",      "Undefined object" },
+       { "42710",      "Duplicate object" },
+       { "42712",      "Duplicate alias" },
+       { "42723",      "Duplicate function" },
+       { "42725",      "Ambiguous function" },
+       { "42803",      "Grouping error" },
+       { "42804",      "Datatype mismatch" },
+       { "42809",      "Wrong object type" },
+       { "42830",      "Invalid foreign key" },
+       { "42846",      "Cannot coerce" },
+       { "42883",      "Undefined function" },
+       { "42939",      "Reserved name" },
+       { "42P01",      "Undefined table" },
+       { "42P02",      "Undefined parameter" },
+       { "42P03",      "Duplicate cursor" },
+       { "42P04",      "Duplicate database" },
+       { "42P05",      "Duplicate prepared statement" },
+       { "42P06",      "Duplicate schema" },
+       { "42P07",      "Duplicate table" },
+       { "42P08",      "Ambiguous parameter" },
+       { "42P09",      "Ambiguous alias" },
+       { "42P10",      "Invalid column reference" },
+       { "42P11",      "Invalid cursor definition" },
+       { "42P12",      "Invalid database definition" },
+       { "42P13",      "Invalid function definition" },
+       { "42P14",      "Invalid prepared statement definition" },
+       { "42P15",      "Invalid schema definition" },
+       { "42P16",      "Invalid table definition" },
+       { "42P17",      "Invalid object definition" },
+       { "42P18",      "Indeterminate datatype" },
        { "42S01",      "Base table or view already exists" },
        { "42S02",      "Base table or view not found" },
        { "42S11",      "Index already exists" },
@@ -95,9 +218,28 @@ static struct pdo_sqlstate_info err_initializer[] = {
        { "42S21",      "Column already exists" },
        { "42S22",      "Column not found" },
        { "44000",      "WITH CHECK OPTION violation" },
+       { "53000",      "Insufficient resources" },
+       { "53100",      "Disk full" },
+       { "53200",      "Out of memory" },
+       { "53300",      "Too many connections" },
+       { "54000",      "Program limit exceeded" },
+       { "54001",      "Statement too complex" },
+       { "54011",      "Too many columns" },
+       { "54023",      "Too many arguments" },
        { "55000",      "Object not in prerequisite state" },
        { "55006",      "Object in use" },
-       { "55P02",      "Cannot change runtime param" },
+       { "55P02",      "Cant change runtime param" },
+       { "55P03",      "Lock not available" },
+       { "57000",      "Operator intervention" },
+       { "57014",      "Query canceled" },
+       { "57P01",      "Admin shutdown" },
+       { "57P02",      "Crash shutdown" },
+       { "57P03",      "Cannot connect now" },
+       { "58030",      "Io error" },
+       { "58P01",      "Undefined file" },
+       { "58P02",      "Duplicate file" },
+       { "F0000",      "Config file error" },
+       { "F0001",      "Lock file exists" },
        { "HY000",      "General error" },
        { "HY001",      "Memory allocation error" },
        { "HY003",      "Invalid application buffer type" },
@@ -154,7 +296,12 @@ static struct pdo_sqlstate_info err_initializer[] = {
        { "IM012",      "DRIVER keyword syntax error" },
        { "IM013",      "Trace file error" },
        { "IM014",      "Invalid name of File DSN" },
-       { "IM015",      "Corrupt file data source" }
+       { "IM015",      "Corrupt file data source" },
+       { "P0000",      "Plpgsql error" },
+       { "P0001",      "Raise exception" },
+       { "XX000",      "Internal error" },
+       { "XX001",      "Data corrupted" },
+       { "XX002",      "Index corrupted" }
 };
 
 void pdo_sqlstate_fini_error_table(void)