Redshift Research Project

System Table Tracker

System view pg_catalog.svv_redshift_functions version 1.0.41465 / 2022-09-10

schema name column data type
pg_catalog svv_redshift_functions argument_type varchar(512)
pg_catalog svv_redshift_functions database_name varchar(128)
pg_catalog svv_redshift_functions function_name varchar(128)
pg_catalog svv_redshift_functions function_type varchar(128)
pg_catalog svv_redshift_functions result_type varchar(128)
pg_catalog svv_redshift_functions schema_name varchar(128)

View Text

SELECT CAST(current_database() AS varchar(128)) AS database_name,
       CAST(pns.nspname AS varchar(128)) AS schema_name,
       CAST(pgp.proname AS varchar(128)) AS function_name,
              WHEN pgp.prorettype = CAST(0 AS oid)
                THEN CAST('STORED PROCEDURE' AS text)
              WHEN pgp.proisagg
                THEN CAST('AGGREGATED FUNCTION' AS text)
              ELSE CAST('REGULAR FUNCTION' AS text)
            END AS varchar) AS function_type,
       CAST(oidvectortypes(pgp.proargtypes) AS varchar) AS argument_type,
              WHEN pgp.proretset
                THEN CAST('setof ' AS text)
              ELSE CAST('' AS text)
            END || format_type(pgp.prorettype,
                               CAST(NULL AS integer)) AS varchar) AS result_type
FROM pg_proc AS pgp
     LEFT JOIN pg_namespace AS pns ON pgp.pronamespace = pns.oid
WHERE has_schema_privilege(CAST("current_user"() AS name),
                           CAST('USAGE' AS text))
  AND has_function_privilege(pgp.oid,
                             CAST('EXECUTE' AS text))
  AND (pns.nspname <> CAST('pg_toast' AS name)
   AND pns.nspname <> CAST('pg_internal' AS name))


SELECT CAST(btrim(CAST(rs_functions.database_name AS text)) AS varchar(128)) AS database_name,
       CAST(btrim(CAST(rs_functions.schema_name AS text)) AS varchar(128)) AS schema_name,
       CAST(btrim(CAST(rs_functions.function_name AS text)) AS varchar(128)) AS function_name,
       CAST(btrim(CAST(rs_functions.function_type AS text)) AS varchar(128)) AS function_type,
       CAST(btrim(CAST(rs_functions.argument_type AS text)) AS varchar(512)) AS argument_type,
       CAST(btrim(CAST(rs_functions.result_type AS text)) AS varchar(128)) AS result_type
FROM pg_get_shared_redshift_functions() AS rs_functions(database_name varchar,
                                                        schema_name varchar,
                                                        function_name varchar,
                                                        function_type varchar,
                                                        argument_type varchar,
                                                        result_type varchar)

Home 3D Друк Blog Bring-Up Times Consultancy Cross-Region Benchmarks Email Forums IRC Mailing Lists Reddit Redshift Price Tracker Redshift Version Tracker Redshift Workbench System Table Tracker The Known Universe Twitter White Papers