The view information_schema.routines contains all functions and procedures in the database.
Note that MonetDB supports function and procedure overloading (same name but with different arguments).
Use the specific_name
instead of routine_name
to distinguish them.
SELECT * FROM information_schema.routines;
SELECT routine_type, routine_schema, routine_name, specific_name, data_type as return_data_type
FROM information_schema.routines WHERE NOT is_system;
information_schema.routines
column name | type | remarks |
---|---|---|
specific_catalog | VARCHAR | Always NULL |
specific_schema | VARCHAR | |
specific_name | VARCHAR | Currently consists of routine_name and function_id between ( and ) |
routine_catalog | VARCHAR | Always NULL |
routine_schema | VARCHAR | |
routine_name | VARCHAR | |
routine_type | VARCHAR | FUNCTION or PROCEDURE or LOADER |
module_catalog | VARCHAR | Always NULL |
module_schema | VARCHAR | Always NULL |
module_name | VARCHAR | |
udt_catalog | VARCHAR | Always NULL |
udt_schema | VARCHAR | Always NULL |
udt_name | VARCHAR | Always NULL |
data_type | VARCHAR | |
character_maximum_length | INTEGER | |
character_octet_length | BIGINT | |
character_set_catalog | VARCHAR | Always NULL |
character_set_schema | VARCHAR | Always NULL |
character_set_name | CHAR | |
collation_catalog | VARCHAR | Always NULL |
collation_schema | VARCHAR | Always NULL |
collation_name | VARCHAR | Always NULL |
numeric_precision | INTEGER | |
numeric_precision_radix | INTEGER | |
numeric_scale | INTEGER | |
datetime_precision | INTEGER | |
interval_type | VARCHAR | |
interval_precision | INTEGER | |
type_udt_catalog | VARCHAR | Always NULL |
type_udt_schema | VARCHAR | Always NULL |
type_udt_name | VARCHAR | Always NULL |
scope_catalog | VARCHAR | Always NULL |
scope_schema | VARCHAR | Always NULL |
scope_name | VARCHAR | Always NULL |
maximum_cardinality | INTEGER | Always NULL |
dtd_identifier | INTEGER | Always NULL |
routine_body | VARCHAR | |
routine_definition | VARCHAR | |
external_name | VARCHAR | |
external_language | VARCHAR | |
parameter_style | CHAR | Currently always GENERAL |
is_deterministic | CHAR | NO or YES |
sql_data_access | VARCHAR | MODIFIES or READ |
is_null_call | VARCHAR | NO or YES or NULL |
sql_path | VARCHAR | Always NULL |
schema_level_routine | VARCHAR | Always NULL |
max_dynamic_result_sets | INTEGER | Always NULL |
is_user_defined_cast | VARCHAR | Always NULL |
is_implicitly_invocable | VARCHAR | Always NULL |
security_type | VARCHAR | Always NULL |
to_sql_specific_catalog | VARCHAR | Always NULL |
to_sql_specific_schema | VARCHAR | Always NULL |
to_sql_specific_name | VARCHAR | Always NULL |
as_locator | VARCHAR | Always NULL |
created | TIMESTAMP | Always NULL |
last_altered | TIMESTAMP | Always NULL |
new_savepoint_level | VARCHAR | Always NULL |
is_udt_dependent | VARCHAR | Always NULL |
result_cast_from_data_type | VARCHAR | Always NULL |
result_cast_as_locator | VARCHAR | Always NULL |
result_cast_char_max_length | INTEGER | Always NULL |
result_cast_char_octet_length | INTEGER | Always NULL |
result_cast_char_set_catalog | VARCHAR | Always NULL |
result_cast_char_set_schema | VARCHAR | Always NULL |
result_cast_character_set_name | VARCHAR | Always NULL |
result_cast_collation_catalog | VARCHAR | Always NULL |
result_cast_collation_schema | VARCHAR | Always NULL |
result_cast_collation_name | VARCHAR | Always NULL |
result_cast_numeric_precision | INTEGER | Always NULL |
result_cast_numeric_radix | INTEGER | Always NULL |
result_cast_numeric_scale | INTEGER | Always NULL |
result_cast_datetime_precision | INTEGER | Always NULL |
result_cast_interval_type | VARCHAR | Always NULL |
result_cast_interval_precision | INTEGER | Always NULL |
result_cast_type_udt_catalog | VARCHAR | Always NULL |
result_cast_type_udt_schema | VARCHAR | Always NULL |
result_cast_type_udt_name | VARCHAR | Always NULL |
result_cast_scope_catalog | VARCHAR | Always NULL |
result_cast_scope_schema | VARCHAR | Always NULL |
result_cast_scope_name | VARCHAR | Always NULL |
result_cast_max_cardinality | INTEGER | Always NULL |
result_cast_dtd_identifier | VARCHAR | Always NULL |
declared_data_type | VARCHAR | Always NULL |
declared_numeric_precision | INTEGER | Always NULL |
declared_numeric_scale | INTEGER | Always NULL |
result_cast_from_declared_data_type | VARCHAR | Always NULL |
result_cast_declared_numeric_precision | INTEGER | Always NULL |
result_cast_declared_numeric_scale | INTEGER | Always NULL |
schema_id | INTEGER | reference to sys.schemas.id |
function_id | INTEGER | reference to sys.functions.id |
function_type | INTEGER | reference to sys.function_types.function_type_id |
function_language | INTEGER | reference to sys.function_languages.language_id |
is_system | BOOLEAN | true when it is a system function or procedure, else false |
comments | VARCHAR |
Note: The last 6 columns (schema_id, function_id, function_type, function_language, is_system and comments) are extensions to the view as defined by ISO standard. They provide useful information and simplify filtering and joins with system tables/views in sys schema when needed.