EDB Postgres Advanced Server exceptions v15

List of server exceptions

The following table lists the predefined exceptions, the SQLstate values, associated redwood error code, and descriptions of the exceptions.

Exception nameSQLStateRedwood error codeDescription
value_error22000-6502The exception occurs when the conversion of a character string to a number fails.
invalid_number22000-6502The exception is raised in PL statement when the conversion of a character string to number fails.
datetime_value_out_of_range22008-1863The exception occurs while writing a field in date format that is outside the valid range.
divide_by_zero22012-1476The exception occurs when a program attempts to divide a number by zero.
zero_divide22012-1476The exception occurs when a program attempts to divide a number by zero.
dup_val_on_index23505-1The exception occurs when a program attempts to store duplicate values in a column that's constrained by a unique index.
invalid_cursor34000-1001The exception occurs when a program attempts a cursor operation on an invalid cursor, such as closing an unopened cursor.
cursor_already_open42P03-6511The exception occurs when a program attempts to open an already open cursor.
collection_is_nullP1403-6531The exception occurs when a program attempts to assign values to the elements of nested table or varray that are uninitialized.
subscript_beyond_countP1404-6533The exception occurs when a program attempts to reference a nested table or varray using an index number larger than the number of elements in the collection.
subscript_outside_limitP1405-6532The exception occurs when a program attempts to reference a nested table or varray element using an index number that's outside the range.
DBMS_CRYPTO package
ciphersuiteinvalid00009-28827The exception occurs when the cipher suite isn't defined.
ciphersuitenull00009-28829The exception occurs when no value is specified for the cipher suite or it contains a NULL value.
keybadsize000090The exception occurs when the specified key size is bad.
keynull00009-28239The exception occurs when the key isn't specified.
UTL_FILE package
invalid_filehandleP0001 00009-29282The exception occurs when file handle is invalid.
invalid_maxlinesizeP0001 00009-29287The exception occurs when the max line size is invalid or the max line size value isn't within the range.
invalid_modeP0001 00009-29281The exception occurs when the open_mode parameter in FOPEN is invalid.
invalid_operationP0001 00009-29283The exception occurs when the file can't be opened or used upon request.
invalid_pathP0001 00009-29280The exception occurs when the file location or file name is invalid.
read_errorP0001 00009-29284The exception occurs when the operating system error occurred during the read operation.
write_errorP0001 00009-29285The exception occurs when the operating system error occurred during the write operation.
UTL_HTTP package
end_of_bodyP0001 00009-29266The exception occurs when the end of HTTP response body is reached.
UTL_URL package
bad_fixed_width_charset00009-29274The exception occurs when the fixed-width multibyte character isn't allowed as a URL character set.
bad_urlP0001 00009-29262The exception occurs when the URL includes badly formed escape-code sequences.

EDB Postgres Advanced Server keywords

A keyword is a word that's recognized by the EDB Postgres Advanced Server parser as having a special meaning or association. You can use the pg_get_keywords() function to retrieve an up-to-date list of the EDB Postgres Advanced Server keywords:

acctg=#
acctg=# SELECT * FROM pg_get_keywords();
Output
        word         | catcode |          catdesc
---------------------+---------+---------------------------------
 abort               | U       | unreserved
 absolute            | U       | unreserved
 access              | U       | unreserved
...

pg_get_keywords returns a table containing the keywords recognized by EDB Postgres Advanced Server:

  • The word column displays the keyword.
  • The catcode column displays a category code.
  • The catdesc column displays a brief description of the category to which the keyword belongs.

You can use any character in an identifier if the name is enclosed in double quotes. You can selectively query the pg_get_keywords() function to retrieve an up-to-date list of the EDB Postgres Advanced Server keywords that belong to a specific category:

SELECT * FROM pg_get_keywords() WHERE catcode = 'code';

Where code is:

R The word is reserved. You can never use reserved keywords as an identifier. They are reserved for use by the server.

U The word is unreserved. Unreserved words are used internally in some contexts, but you can use them as a name for a database object.

T The word is used internally but can be used as a name for a function or type.

C The word is used internally and can't be used as a name for a function or type.

For more information about EDB Postgres Advanced Server identifiers and keywords, see the PostgreSQL core documentation.