Skip to content

Commit 348b621

Browse files
committed
Show aggregate return types in psql \da output.
Greg Sabino Mullane
1 parent 95f6d2d commit 348b621

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

doc/src/sgml/ref/psql-ref.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.188 2007/03/03 17:19:11 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.189 2007/03/16 08:28:01 mha Exp $
33
PostgreSQL documentation
44
-->
55

@@ -875,8 +875,8 @@ testdb=&gt;
875875

876876
<listitem>
877877
<para>
878-
Lists all available aggregate functions, together with the data
879-
types they operate on. If <replaceable
878+
Lists all available aggregate functions, together with their
879+
return type and the data types they operate on. If <replaceable
880880
class="parameter">pattern</replaceable>
881881
is specified, only aggregates whose names match the pattern are shown.
882882
</para>

src/bin/psql/describe.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.152 2007/02/20 10:23:38 petere Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.153 2007/03/16 08:28:01 mha Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "describe.h"
@@ -62,21 +62,22 @@ describeAggregates(const char *pattern, bool verbose)
6262
printfPQExpBuffer(&buf,
6363
"SELECT n.nspname as \"%s\",\n"
6464
" p.proname AS \"%s\",\n"
65+
" pg_catalog.format_type(p.prorettype, NULL) AS \"%s\",\n"
6566
" CASE WHEN p.pronargs = 0\n"
6667
" THEN CAST('*' AS pg_catalog.text)\n"
6768
" ELSE\n"
6869
" pg_catalog.array_to_string(ARRAY(\n"
6970
" SELECT\n"
70-
" pg_catalog.format_type(p.proargtypes[s.i], NULL)\n"
71+
" pg_catalog.format_type(p.proargtypes[s.i], NULL)\n"
7172
" FROM\n"
7273
" pg_catalog.generate_series(0, pg_catalog.array_upper(p.proargtypes, 1)) AS s(i)\n"
7374
" ), ', ')\n"
7475
" END AS \"%s\",\n"
75-
" pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"\n"
76+
" pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"\n"
7677
"FROM pg_catalog.pg_proc p\n"
77-
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
78+
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
7879
"WHERE p.proisagg\n",
79-
_("Schema"), _("Name"),
80+
_("Schema"), _("Name"), _("Result data type"),
8081
_("Argument data types"), _("Description"));
8182

8283
processSQLNamePattern(pset.db, &buf, pattern, true, false,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy