0

使用:

SELECT  * FROM information_schema.routines

或者

SELECT  * FROM pg_catalog.pg_proc

我可以得到系统功能列表。是否存在获取功能描述甚至更好分类的方法?喜欢这里这里

我不相信有人用手打字:)

谢谢!

4

1 回答 1

1

psql外壳中,您可以获得类似的信息

\daS

                                                                                 List of aggregate functions
   Schema   |      Name      |      Result data type       |        Argument data types         |                      
------------+----------------+-----------------------------+------------------------------------+----------------------
 pg_catalog | array_agg      | anyarray                    | anyelement                         | concatenate aggregate
 pg_catalog | avg            | numeric                     | bigint                             | the average (arithmet
 pg_catalog | avg            | double precision            | double precision                   | the average (arithmet
....

您可以通过使用参数启动 shell 来查看psqlshell 为获取此信息所做的工作-E

********* QUERY **********
SELECT n.nspname as "Schema",
  p.proname AS "Name",
  pg_catalog.format_type(p.prorettype, NULL) AS "Result data type",
  CASE WHEN p.pronargs = 0
    THEN CAST('*' AS pg_catalog.text)
    ELSE
    pg_catalog.array_to_string(ARRAY(
      SELECT
        pg_catalog.format_type(p.proargtypes[s.i], NULL)
      FROM
        pg_catalog.generate_series(0, pg_catalog.array_upper(p.proargtypes, 1)) AS s(i)
    ), ', ')
  END AS "Argument data types",
  pg_catalog.obj_description(p.oid, 'pg_proc') as "Description"
FROM pg_catalog.pg_proc p
     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
WHERE p.proisagg
  AND pg_catalog.pg_function_is_visible(p.oid)
ORDER BY 1, 2, 4;
**************************
于 2012-11-22T18:31:08.117 回答