Advanced Server Exceptions v13

The following table lists the pre-defined exceptions, the SQLstate values, associated redwood error code, and description 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, which 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 is 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 is outside the range.

Redwood Built-in Package Exceptions

DBMS_CRYPTO Package
ciphersuiteinvalid00009-28827The exception occurs when the cipher suite is not defined.
ciphersuitenull00009-28829The exception occurs when no value is specified for the cipher suite or contains a NULL value.
keybadsize000090The exception occurs when the specified key size is bad.
keynull00009-28239The exception occurs when the key is not 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 is not 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 could not be opened or used upon request.
invalid_pathP0001 00009-29280The exception occurs when the file location or filename 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 is not allowed as a URL character set.
bad_urlP0001 00009-29262The exception occurs when the URL includes badly formed escape code sequences.

Advanced Server Keywords

A keyword is a word that is recognized by the 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 Advanced Server keywords:

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

pg_get_keywords returns a table containing the keywords recognized by 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.

Note that any character can be used 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 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. Reserved keywords may never be used 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 may be used as a name for a database object.

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

C - The word is used internally, and may not be used as a name for a function or type.

For more information about Advanced Server identifiers and keywords, see to the PostgreSQL core documentation at:

https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html