summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2007-03-16 08:28:01 +0000
committerMagnus Hagander2007-03-16 08:28:01 +0000
commit348b62189491f60efe0ee15618492e7786338e06 (patch)
tree19770eb6a0943b8b3a49bae90d250c7fb6427836
parent95f6d2d20921b7c2dbec29bf2706fd9448208aa6 (diff)
Show aggregate return types in psql \da output.
Greg Sabino Mullane
-rw-r--r--doc/src/sgml/ref/psql-ref.sgml6
-rw-r--r--src/bin/psql/describe.c11
2 files changed, 9 insertions, 8 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 29037dbe20f..644a71b7920 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1,5 +1,5 @@
<!--
-$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
-->
@@ -875,8 +875,8 @@ testdb=&gt;
<listitem>
<para>
- Lists all available aggregate functions, together with the data
- types they operate on. If <replaceable
+ Lists all available aggregate functions, together with their
+ return type and the data types they operate on. If <replaceable
class="parameter">pattern</replaceable>
is specified, only aggregates whose names match the pattern are shown.
</para>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 62fde7cbe4a..0d6551e447a 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -3,7 +3,7 @@
*
* 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 "describe.h"
@@ -62,21 +62,22 @@ describeAggregates(const char *pattern, bool verbose)
printfPQExpBuffer(&buf,
"SELECT n.nspname as \"%s\",\n"
" p.proname AS \"%s\",\n"
+ " pg_catalog.format_type(p.prorettype, NULL) AS \"%s\",\n"
" CASE WHEN p.pronargs = 0\n"
" THEN CAST('*' AS pg_catalog.text)\n"
" ELSE\n"
" pg_catalog.array_to_string(ARRAY(\n"
" SELECT\n"
- " pg_catalog.format_type(p.proargtypes[s.i], NULL)\n"
+ " pg_catalog.format_type(p.proargtypes[s.i], NULL)\n"
" FROM\n"
" pg_catalog.generate_series(0, pg_catalog.array_upper(p.proargtypes, 1)) AS s(i)\n"
" ), ', ')\n"
" END AS \"%s\",\n"
- " pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"\n"
+ " pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"\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",
- _("Schema"), _("Name"),
+ _("Schema"), _("Name"), _("Result data type"),
_("Argument data types"), _("Description"));
processSQLNamePattern(pset.db, &buf, pattern, true, false,