errorcodes.py 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. """Error codes for PostgreSQL
  2. This module contains symbolic names for all PostgreSQL error codes.
  3. """
  4. # psycopg2/errorcodes.py - PostgreSQL error codes
  5. #
  6. # Copyright (C) 2006-2019 Johan Dahlin <jdahlin@async.com.br>
  7. # Copyright (C) 2020-2021 The Psycopg Team
  8. #
  9. # psycopg2 is free software: you can redistribute it and/or modify it
  10. # under the terms of the GNU Lesser General Public License as published
  11. # by the Free Software Foundation, either version 3 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # In addition, as a special exception, the copyright holders give
  15. # permission to link this program with the OpenSSL library (or with
  16. # modified versions of OpenSSL that use the same license as OpenSSL),
  17. # and distribute linked combinations including the two.
  18. #
  19. # You must obey the GNU Lesser General Public License in all respects for
  20. # all of the code used other than OpenSSL.
  21. #
  22. # psycopg2 is distributed in the hope that it will be useful, but WITHOUT
  23. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  24. # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  25. # License for more details.
  26. #
  27. # Based on:
  28. #
  29. # https://www.postgresql.org/docs/current/static/errcodes-appendix.html
  30. #
  31. def lookup(code, _cache={}):
  32. """Lookup an error code or class code and return its symbolic name.
  33. Raise `KeyError` if the code is not found.
  34. """
  35. if _cache:
  36. return _cache[code]
  37. # Generate the lookup map at first usage.
  38. tmp = {}
  39. for k, v in globals().items():
  40. if isinstance(v, str) and len(v) in (2, 5):
  41. # Strip trailing underscore used to disambiguate duplicate values
  42. tmp[v] = k.rstrip("_")
  43. assert tmp
  44. # Atomic update, to avoid race condition on import (bug #382)
  45. _cache.update(tmp)
  46. return _cache[code]
  47. # autogenerated data: do not edit below this point.
  48. # Error classes
  49. CLASS_SUCCESSFUL_COMPLETION = '00'
  50. CLASS_WARNING = '01'
  51. CLASS_NO_DATA = '02'
  52. CLASS_SQL_STATEMENT_NOT_YET_COMPLETE = '03'
  53. CLASS_CONNECTION_EXCEPTION = '08'
  54. CLASS_TRIGGERED_ACTION_EXCEPTION = '09'
  55. CLASS_FEATURE_NOT_SUPPORTED = '0A'
  56. CLASS_INVALID_TRANSACTION_INITIATION = '0B'
  57. CLASS_LOCATOR_EXCEPTION = '0F'
  58. CLASS_INVALID_GRANTOR = '0L'
  59. CLASS_INVALID_ROLE_SPECIFICATION = '0P'
  60. CLASS_DIAGNOSTICS_EXCEPTION = '0Z'
  61. CLASS_CASE_NOT_FOUND = '20'
  62. CLASS_CARDINALITY_VIOLATION = '21'
  63. CLASS_DATA_EXCEPTION = '22'
  64. CLASS_INTEGRITY_CONSTRAINT_VIOLATION = '23'
  65. CLASS_INVALID_CURSOR_STATE = '24'
  66. CLASS_INVALID_TRANSACTION_STATE = '25'
  67. CLASS_INVALID_SQL_STATEMENT_NAME = '26'
  68. CLASS_TRIGGERED_DATA_CHANGE_VIOLATION = '27'
  69. CLASS_INVALID_AUTHORIZATION_SPECIFICATION = '28'
  70. CLASS_DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST = '2B'
  71. CLASS_INVALID_TRANSACTION_TERMINATION = '2D'
  72. CLASS_SQL_ROUTINE_EXCEPTION = '2F'
  73. CLASS_INVALID_CURSOR_NAME = '34'
  74. CLASS_EXTERNAL_ROUTINE_EXCEPTION = '38'
  75. CLASS_EXTERNAL_ROUTINE_INVOCATION_EXCEPTION = '39'
  76. CLASS_SAVEPOINT_EXCEPTION = '3B'
  77. CLASS_INVALID_CATALOG_NAME = '3D'
  78. CLASS_INVALID_SCHEMA_NAME = '3F'
  79. CLASS_TRANSACTION_ROLLBACK = '40'
  80. CLASS_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = '42'
  81. CLASS_WITH_CHECK_OPTION_VIOLATION = '44'
  82. CLASS_INSUFFICIENT_RESOURCES = '53'
  83. CLASS_PROGRAM_LIMIT_EXCEEDED = '54'
  84. CLASS_OBJECT_NOT_IN_PREREQUISITE_STATE = '55'
  85. CLASS_OPERATOR_INTERVENTION = '57'
  86. CLASS_SYSTEM_ERROR = '58'
  87. CLASS_SNAPSHOT_FAILURE = '72'
  88. CLASS_CONFIGURATION_FILE_ERROR = 'F0'
  89. CLASS_FOREIGN_DATA_WRAPPER_ERROR = 'HV'
  90. CLASS_PL_PGSQL_ERROR = 'P0'
  91. CLASS_INTERNAL_ERROR = 'XX'
  92. # Class 00 - Successful Completion
  93. SUCCESSFUL_COMPLETION = '00000'
  94. # Class 01 - Warning
  95. WARNING = '01000'
  96. NULL_VALUE_ELIMINATED_IN_SET_FUNCTION = '01003'
  97. STRING_DATA_RIGHT_TRUNCATION_ = '01004'
  98. PRIVILEGE_NOT_REVOKED = '01006'
  99. PRIVILEGE_NOT_GRANTED = '01007'
  100. IMPLICIT_ZERO_BIT_PADDING = '01008'
  101. DYNAMIC_RESULT_SETS_RETURNED = '0100C'
  102. DEPRECATED_FEATURE = '01P01'
  103. # Class 02 - No Data (this is also a warning class per the SQL standard)
  104. NO_DATA = '02000'
  105. NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED = '02001'
  106. # Class 03 - SQL Statement Not Yet Complete
  107. SQL_STATEMENT_NOT_YET_COMPLETE = '03000'
  108. # Class 08 - Connection Exception
  109. CONNECTION_EXCEPTION = '08000'
  110. SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION = '08001'
  111. CONNECTION_DOES_NOT_EXIST = '08003'
  112. SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION = '08004'
  113. CONNECTION_FAILURE = '08006'
  114. TRANSACTION_RESOLUTION_UNKNOWN = '08007'
  115. PROTOCOL_VIOLATION = '08P01'
  116. # Class 09 - Triggered Action Exception
  117. TRIGGERED_ACTION_EXCEPTION = '09000'
  118. # Class 0A - Feature Not Supported
  119. FEATURE_NOT_SUPPORTED = '0A000'
  120. # Class 0B - Invalid Transaction Initiation
  121. INVALID_TRANSACTION_INITIATION = '0B000'
  122. # Class 0F - Locator Exception
  123. LOCATOR_EXCEPTION = '0F000'
  124. INVALID_LOCATOR_SPECIFICATION = '0F001'
  125. # Class 0L - Invalid Grantor
  126. INVALID_GRANTOR = '0L000'
  127. INVALID_GRANT_OPERATION = '0LP01'
  128. # Class 0P - Invalid Role Specification
  129. INVALID_ROLE_SPECIFICATION = '0P000'
  130. # Class 0Z - Diagnostics Exception
  131. DIAGNOSTICS_EXCEPTION = '0Z000'
  132. STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER = '0Z002'
  133. # Class 20 - Case Not Found
  134. CASE_NOT_FOUND = '20000'
  135. # Class 21 - Cardinality Violation
  136. CARDINALITY_VIOLATION = '21000'
  137. # Class 22 - Data Exception
  138. DATA_EXCEPTION = '22000'
  139. STRING_DATA_RIGHT_TRUNCATION = '22001'
  140. NULL_VALUE_NO_INDICATOR_PARAMETER = '22002'
  141. NUMERIC_VALUE_OUT_OF_RANGE = '22003'
  142. NULL_VALUE_NOT_ALLOWED_ = '22004'
  143. ERROR_IN_ASSIGNMENT = '22005'
  144. INVALID_DATETIME_FORMAT = '22007'
  145. DATETIME_FIELD_OVERFLOW = '22008'
  146. INVALID_TIME_ZONE_DISPLACEMENT_VALUE = '22009'
  147. ESCAPE_CHARACTER_CONFLICT = '2200B'
  148. INVALID_USE_OF_ESCAPE_CHARACTER = '2200C'
  149. INVALID_ESCAPE_OCTET = '2200D'
  150. ZERO_LENGTH_CHARACTER_STRING = '2200F'
  151. MOST_SPECIFIC_TYPE_MISMATCH = '2200G'
  152. SEQUENCE_GENERATOR_LIMIT_EXCEEDED = '2200H'
  153. NOT_AN_XML_DOCUMENT = '2200L'
  154. INVALID_XML_DOCUMENT = '2200M'
  155. INVALID_XML_CONTENT = '2200N'
  156. INVALID_XML_COMMENT = '2200S'
  157. INVALID_XML_PROCESSING_INSTRUCTION = '2200T'
  158. INVALID_INDICATOR_PARAMETER_VALUE = '22010'
  159. SUBSTRING_ERROR = '22011'
  160. DIVISION_BY_ZERO = '22012'
  161. INVALID_PRECEDING_OR_FOLLOWING_SIZE = '22013'
  162. INVALID_ARGUMENT_FOR_NTILE_FUNCTION = '22014'
  163. INTERVAL_FIELD_OVERFLOW = '22015'
  164. INVALID_ARGUMENT_FOR_NTH_VALUE_FUNCTION = '22016'
  165. INVALID_CHARACTER_VALUE_FOR_CAST = '22018'
  166. INVALID_ESCAPE_CHARACTER = '22019'
  167. INVALID_REGULAR_EXPRESSION = '2201B'
  168. INVALID_ARGUMENT_FOR_LOGARITHM = '2201E'
  169. INVALID_ARGUMENT_FOR_POWER_FUNCTION = '2201F'
  170. INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION = '2201G'
  171. INVALID_ROW_COUNT_IN_LIMIT_CLAUSE = '2201W'
  172. INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE = '2201X'
  173. INVALID_LIMIT_VALUE = '22020'
  174. CHARACTER_NOT_IN_REPERTOIRE = '22021'
  175. INDICATOR_OVERFLOW = '22022'
  176. INVALID_PARAMETER_VALUE = '22023'
  177. UNTERMINATED_C_STRING = '22024'
  178. INVALID_ESCAPE_SEQUENCE = '22025'
  179. STRING_DATA_LENGTH_MISMATCH = '22026'
  180. TRIM_ERROR = '22027'
  181. ARRAY_SUBSCRIPT_ERROR = '2202E'
  182. INVALID_TABLESAMPLE_REPEAT = '2202G'
  183. INVALID_TABLESAMPLE_ARGUMENT = '2202H'
  184. DUPLICATE_JSON_OBJECT_KEY_VALUE = '22030'
  185. INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION = '22031'
  186. INVALID_JSON_TEXT = '22032'
  187. INVALID_SQL_JSON_SUBSCRIPT = '22033'
  188. MORE_THAN_ONE_SQL_JSON_ITEM = '22034'
  189. NO_SQL_JSON_ITEM = '22035'
  190. NON_NUMERIC_SQL_JSON_ITEM = '22036'
  191. NON_UNIQUE_KEYS_IN_A_JSON_OBJECT = '22037'
  192. SINGLETON_SQL_JSON_ITEM_REQUIRED = '22038'
  193. SQL_JSON_ARRAY_NOT_FOUND = '22039'
  194. SQL_JSON_MEMBER_NOT_FOUND = '2203A'
  195. SQL_JSON_NUMBER_NOT_FOUND = '2203B'
  196. SQL_JSON_OBJECT_NOT_FOUND = '2203C'
  197. TOO_MANY_JSON_ARRAY_ELEMENTS = '2203D'
  198. TOO_MANY_JSON_OBJECT_MEMBERS = '2203E'
  199. SQL_JSON_SCALAR_REQUIRED = '2203F'
  200. FLOATING_POINT_EXCEPTION = '22P01'
  201. INVALID_TEXT_REPRESENTATION = '22P02'
  202. INVALID_BINARY_REPRESENTATION = '22P03'
  203. BAD_COPY_FILE_FORMAT = '22P04'
  204. UNTRANSLATABLE_CHARACTER = '22P05'
  205. NONSTANDARD_USE_OF_ESCAPE_CHARACTER = '22P06'
  206. # Class 23 - Integrity Constraint Violation
  207. INTEGRITY_CONSTRAINT_VIOLATION = '23000'
  208. RESTRICT_VIOLATION = '23001'
  209. NOT_NULL_VIOLATION = '23502'
  210. FOREIGN_KEY_VIOLATION = '23503'
  211. UNIQUE_VIOLATION = '23505'
  212. CHECK_VIOLATION = '23514'
  213. EXCLUSION_VIOLATION = '23P01'
  214. # Class 24 - Invalid Cursor State
  215. INVALID_CURSOR_STATE = '24000'
  216. # Class 25 - Invalid Transaction State
  217. INVALID_TRANSACTION_STATE = '25000'
  218. ACTIVE_SQL_TRANSACTION = '25001'
  219. BRANCH_TRANSACTION_ALREADY_ACTIVE = '25002'
  220. INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION = '25003'
  221. INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION = '25004'
  222. NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION = '25005'
  223. READ_ONLY_SQL_TRANSACTION = '25006'
  224. SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED = '25007'
  225. HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL = '25008'
  226. NO_ACTIVE_SQL_TRANSACTION = '25P01'
  227. IN_FAILED_SQL_TRANSACTION = '25P02'
  228. IDLE_IN_TRANSACTION_SESSION_TIMEOUT = '25P03'
  229. # Class 26 - Invalid SQL Statement Name
  230. INVALID_SQL_STATEMENT_NAME = '26000'
  231. # Class 27 - Triggered Data Change Violation
  232. TRIGGERED_DATA_CHANGE_VIOLATION = '27000'
  233. # Class 28 - Invalid Authorization Specification
  234. INVALID_AUTHORIZATION_SPECIFICATION = '28000'
  235. INVALID_PASSWORD = '28P01'
  236. # Class 2B - Dependent Privilege Descriptors Still Exist
  237. DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST = '2B000'
  238. DEPENDENT_OBJECTS_STILL_EXIST = '2BP01'
  239. # Class 2D - Invalid Transaction Termination
  240. INVALID_TRANSACTION_TERMINATION = '2D000'
  241. # Class 2F - SQL Routine Exception
  242. SQL_ROUTINE_EXCEPTION = '2F000'
  243. MODIFYING_SQL_DATA_NOT_PERMITTED_ = '2F002'
  244. PROHIBITED_SQL_STATEMENT_ATTEMPTED_ = '2F003'
  245. READING_SQL_DATA_NOT_PERMITTED_ = '2F004'
  246. FUNCTION_EXECUTED_NO_RETURN_STATEMENT = '2F005'
  247. # Class 34 - Invalid Cursor Name
  248. INVALID_CURSOR_NAME = '34000'
  249. # Class 38 - External Routine Exception
  250. EXTERNAL_ROUTINE_EXCEPTION = '38000'
  251. CONTAINING_SQL_NOT_PERMITTED = '38001'
  252. MODIFYING_SQL_DATA_NOT_PERMITTED = '38002'
  253. PROHIBITED_SQL_STATEMENT_ATTEMPTED = '38003'
  254. READING_SQL_DATA_NOT_PERMITTED = '38004'
  255. # Class 39 - External Routine Invocation Exception
  256. EXTERNAL_ROUTINE_INVOCATION_EXCEPTION = '39000'
  257. INVALID_SQLSTATE_RETURNED = '39001'
  258. NULL_VALUE_NOT_ALLOWED = '39004'
  259. TRIGGER_PROTOCOL_VIOLATED = '39P01'
  260. SRF_PROTOCOL_VIOLATED = '39P02'
  261. EVENT_TRIGGER_PROTOCOL_VIOLATED = '39P03'
  262. # Class 3B - Savepoint Exception
  263. SAVEPOINT_EXCEPTION = '3B000'
  264. INVALID_SAVEPOINT_SPECIFICATION = '3B001'
  265. # Class 3D - Invalid Catalog Name
  266. INVALID_CATALOG_NAME = '3D000'
  267. # Class 3F - Invalid Schema Name
  268. INVALID_SCHEMA_NAME = '3F000'
  269. # Class 40 - Transaction Rollback
  270. TRANSACTION_ROLLBACK = '40000'
  271. SERIALIZATION_FAILURE = '40001'
  272. TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION = '40002'
  273. STATEMENT_COMPLETION_UNKNOWN = '40003'
  274. DEADLOCK_DETECTED = '40P01'
  275. # Class 42 - Syntax Error or Access Rule Violation
  276. SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = '42000'
  277. INSUFFICIENT_PRIVILEGE = '42501'
  278. SYNTAX_ERROR = '42601'
  279. INVALID_NAME = '42602'
  280. INVALID_COLUMN_DEFINITION = '42611'
  281. NAME_TOO_LONG = '42622'
  282. DUPLICATE_COLUMN = '42701'
  283. AMBIGUOUS_COLUMN = '42702'
  284. UNDEFINED_COLUMN = '42703'
  285. UNDEFINED_OBJECT = '42704'
  286. DUPLICATE_OBJECT = '42710'
  287. DUPLICATE_ALIAS = '42712'
  288. DUPLICATE_FUNCTION = '42723'
  289. AMBIGUOUS_FUNCTION = '42725'
  290. GROUPING_ERROR = '42803'
  291. DATATYPE_MISMATCH = '42804'
  292. WRONG_OBJECT_TYPE = '42809'
  293. INVALID_FOREIGN_KEY = '42830'
  294. CANNOT_COERCE = '42846'
  295. UNDEFINED_FUNCTION = '42883'
  296. GENERATED_ALWAYS = '428C9'
  297. RESERVED_NAME = '42939'
  298. UNDEFINED_TABLE = '42P01'
  299. UNDEFINED_PARAMETER = '42P02'
  300. DUPLICATE_CURSOR = '42P03'
  301. DUPLICATE_DATABASE = '42P04'
  302. DUPLICATE_PREPARED_STATEMENT = '42P05'
  303. DUPLICATE_SCHEMA = '42P06'
  304. DUPLICATE_TABLE = '42P07'
  305. AMBIGUOUS_PARAMETER = '42P08'
  306. AMBIGUOUS_ALIAS = '42P09'
  307. INVALID_COLUMN_REFERENCE = '42P10'
  308. INVALID_CURSOR_DEFINITION = '42P11'
  309. INVALID_DATABASE_DEFINITION = '42P12'
  310. INVALID_FUNCTION_DEFINITION = '42P13'
  311. INVALID_PREPARED_STATEMENT_DEFINITION = '42P14'
  312. INVALID_SCHEMA_DEFINITION = '42P15'
  313. INVALID_TABLE_DEFINITION = '42P16'
  314. INVALID_OBJECT_DEFINITION = '42P17'
  315. INDETERMINATE_DATATYPE = '42P18'
  316. INVALID_RECURSION = '42P19'
  317. WINDOWING_ERROR = '42P20'
  318. COLLATION_MISMATCH = '42P21'
  319. INDETERMINATE_COLLATION = '42P22'
  320. # Class 44 - WITH CHECK OPTION Violation
  321. WITH_CHECK_OPTION_VIOLATION = '44000'
  322. # Class 53 - Insufficient Resources
  323. INSUFFICIENT_RESOURCES = '53000'
  324. DISK_FULL = '53100'
  325. OUT_OF_MEMORY = '53200'
  326. TOO_MANY_CONNECTIONS = '53300'
  327. CONFIGURATION_LIMIT_EXCEEDED = '53400'
  328. # Class 54 - Program Limit Exceeded
  329. PROGRAM_LIMIT_EXCEEDED = '54000'
  330. STATEMENT_TOO_COMPLEX = '54001'
  331. TOO_MANY_COLUMNS = '54011'
  332. TOO_MANY_ARGUMENTS = '54023'
  333. # Class 55 - Object Not In Prerequisite State
  334. OBJECT_NOT_IN_PREREQUISITE_STATE = '55000'
  335. OBJECT_IN_USE = '55006'
  336. CANT_CHANGE_RUNTIME_PARAM = '55P02'
  337. LOCK_NOT_AVAILABLE = '55P03'
  338. UNSAFE_NEW_ENUM_VALUE_USAGE = '55P04'
  339. # Class 57 - Operator Intervention
  340. OPERATOR_INTERVENTION = '57000'
  341. QUERY_CANCELED = '57014'
  342. ADMIN_SHUTDOWN = '57P01'
  343. CRASH_SHUTDOWN = '57P02'
  344. CANNOT_CONNECT_NOW = '57P03'
  345. DATABASE_DROPPED = '57P04'
  346. IDLE_SESSION_TIMEOUT = '57P05'
  347. # Class 58 - System Error (errors external to PostgreSQL itself)
  348. SYSTEM_ERROR = '58000'
  349. IO_ERROR = '58030'
  350. UNDEFINED_FILE = '58P01'
  351. DUPLICATE_FILE = '58P02'
  352. # Class 72 - Snapshot Failure
  353. SNAPSHOT_TOO_OLD = '72000'
  354. # Class F0 - Configuration File Error
  355. CONFIG_FILE_ERROR = 'F0000'
  356. LOCK_FILE_EXISTS = 'F0001'
  357. # Class HV - Foreign Data Wrapper Error (SQL/MED)
  358. FDW_ERROR = 'HV000'
  359. FDW_OUT_OF_MEMORY = 'HV001'
  360. FDW_DYNAMIC_PARAMETER_VALUE_NEEDED = 'HV002'
  361. FDW_INVALID_DATA_TYPE = 'HV004'
  362. FDW_COLUMN_NAME_NOT_FOUND = 'HV005'
  363. FDW_INVALID_DATA_TYPE_DESCRIPTORS = 'HV006'
  364. FDW_INVALID_COLUMN_NAME = 'HV007'
  365. FDW_INVALID_COLUMN_NUMBER = 'HV008'
  366. FDW_INVALID_USE_OF_NULL_POINTER = 'HV009'
  367. FDW_INVALID_STRING_FORMAT = 'HV00A'
  368. FDW_INVALID_HANDLE = 'HV00B'
  369. FDW_INVALID_OPTION_INDEX = 'HV00C'
  370. FDW_INVALID_OPTION_NAME = 'HV00D'
  371. FDW_OPTION_NAME_NOT_FOUND = 'HV00J'
  372. FDW_REPLY_HANDLE = 'HV00K'
  373. FDW_UNABLE_TO_CREATE_EXECUTION = 'HV00L'
  374. FDW_UNABLE_TO_CREATE_REPLY = 'HV00M'
  375. FDW_UNABLE_TO_ESTABLISH_CONNECTION = 'HV00N'
  376. FDW_NO_SCHEMAS = 'HV00P'
  377. FDW_SCHEMA_NOT_FOUND = 'HV00Q'
  378. FDW_TABLE_NOT_FOUND = 'HV00R'
  379. FDW_FUNCTION_SEQUENCE_ERROR = 'HV010'
  380. FDW_TOO_MANY_HANDLES = 'HV014'
  381. FDW_INCONSISTENT_DESCRIPTOR_INFORMATION = 'HV021'
  382. FDW_INVALID_ATTRIBUTE_VALUE = 'HV024'
  383. FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH = 'HV090'
  384. FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER = 'HV091'
  385. # Class P0 - PL/pgSQL Error
  386. PLPGSQL_ERROR = 'P0000'
  387. RAISE_EXCEPTION = 'P0001'
  388. NO_DATA_FOUND = 'P0002'
  389. TOO_MANY_ROWS = 'P0003'
  390. ASSERT_FAILURE = 'P0004'
  391. # Class XX - Internal Error
  392. INTERNAL_ERROR = 'XX000'
  393. DATA_CORRUPTED = 'XX001'
  394. INDEX_CORRUPTED = 'XX002'