]> granicus.if.org Git - postgresql/commitdiff
Make psql's \df display functions that return sets as having return type
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 Oct 2002 20:50:44 +0000 (20:50 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 Oct 2002 20:50:44 +0000 (20:50 +0000)
'setof something'; formerly you could not tell at all that the function
returns set.

src/bin/psql/describe.c

index 017afbc83c73ad896e6d0da3246abc3c21abe668..dae66b22d0babd81ed33999b6007553e4a041835 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright 2000-2002 by PostgreSQL Global Development Group
  *
- * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.70 2002/10/15 02:24:16 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.71 2002/10/19 20:50:44 tgl Exp $
  */
 #include "postgres_fe.h"
 #include "describe.h"
@@ -119,9 +119,10 @@ describeFunctions(const char *pattern, bool verbose)
        initPQExpBuffer(&buf);
 
        printfPQExpBuffer(&buf,
-                "SELECT pg_catalog.format_type(p.prorettype, NULL) as \"%s\",\n"
-                                         "  n.nspname as \"%s\",\n"
-                                         "  p.proname as \"%s\",\n"
+                "SELECT CASE WHEN p.proretset THEN 'setof ' ELSE '' END ||\n"
+                                 "  pg_catalog.format_type(p.prorettype, NULL) as \"%s\",\n"
+                                 "  n.nspname as \"%s\",\n"
+                                 "  p.proname as \"%s\",\n"
                                  "  pg_catalog.oidvectortypes(p.proargtypes) as \"%s\"",
                                          _("Result data type"), _("Schema"), _("Name"),
                                          _("Argument data types"));