Commit 348b6218 authored by Magnus Hagander's avatar Magnus Hagander

Show aggregate return types in psql \da output.

Greg Sabino Mullane
parent 95f6d2d2
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.188 2007/03/03 17:19:11 momjian Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.189 2007/03/16 08:28:01 mha Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -875,8 +875,8 @@ testdb=&gt; ...@@ -875,8 +875,8 @@ testdb=&gt;
<listitem> <listitem>
<para> <para>
Lists all available aggregate functions, together with the data Lists all available aggregate functions, together with their
types they operate on. If <replaceable return type and the data types they operate on. If <replaceable
class="parameter">pattern</replaceable> class="parameter">pattern</replaceable>
is specified, only aggregates whose names match the pattern are shown. is specified, only aggregates whose names match the pattern are shown.
</para> </para>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2007, PostgreSQL Global Development Group * Copyright (c) 2000-2007, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.152 2007/02/20 10:23:38 petere Exp $ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.153 2007/03/16 08:28:01 mha Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "describe.h" #include "describe.h"
...@@ -62,6 +62,7 @@ describeAggregates(const char *pattern, bool verbose) ...@@ -62,6 +62,7 @@ describeAggregates(const char *pattern, bool verbose)
printfPQExpBuffer(&buf, printfPQExpBuffer(&buf,
"SELECT n.nspname as \"%s\",\n" "SELECT n.nspname as \"%s\",\n"
" p.proname AS \"%s\",\n" " p.proname AS \"%s\",\n"
" pg_catalog.format_type(p.prorettype, NULL) AS \"%s\",\n"
" CASE WHEN p.pronargs = 0\n" " CASE WHEN p.pronargs = 0\n"
" THEN CAST('*' AS pg_catalog.text)\n" " THEN CAST('*' AS pg_catalog.text)\n"
" ELSE\n" " ELSE\n"
...@@ -76,7 +77,7 @@ describeAggregates(const char *pattern, bool verbose) ...@@ -76,7 +77,7 @@ describeAggregates(const char *pattern, bool verbose)
"FROM pg_catalog.pg_proc p\n" "FROM pg_catalog.pg_proc p\n"
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n" " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
"WHERE p.proisagg\n", "WHERE p.proisagg\n",
_("Schema"), _("Name"), _("Schema"), _("Name"), _("Result data type"),
_("Argument data types"), _("Description")); _("Argument data types"), _("Description"));
processSQLNamePattern(pset.db, &buf, pattern, true, false, processSQLNamePattern(pset.db, &buf, pattern, true, false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment