Remove psql's ancient hack that suppressed functions taking or returning
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Apr 2009 22:29:30 +0000 (22:29 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Apr 2009 22:29:30 +0000 (22:29 +0000)
cstring from the output of \df.  Now that the default behavior is to
exclude all system functions, the de-cluttering rationale for this behavior
seems pretty weak; and it was always quite confusing/unhelpful if you were
actually looking for I/O functions.  (Not to mention if you were looking
for encoding converters or other cases that might take or return cstring.)

doc/src/sgml/ref/psql-ref.sgml
src/bin/psql/describe.c

index 14846f73bd80f29f66f4776855afea1e84077346..10d42ca3f5dfdb60e95074d22135e8e8ddec39da 100644 (file)
@@ -1055,16 +1055,10 @@ testdb=&gt;
 
         <note>
         <para>
-        To look up functions taking argument or returning values of a specific
+        To look up functions taking arguments or returning values of a specific
         type, use your pager's search capability to scroll through the <literal>\df</>
         output.
         </para>
-
-        <para>
-        To reduce clutter, <literal>\df</> does not show data type I/O
-        functions.  This is implemented by ignoring functions that accept
-        or return type <type>cstring</>.
-        </para>
         </note>
 
         </listitem>
index cc8898439fd71e90f0522b9031bee6021f35d0da..731baf803936b40b6b37c177295cd0c9c104d836 100644 (file)
@@ -274,13 +274,7 @@ describeFunctions(const char *pattern, bool verbose, bool showSystem)
                appendPQExpBuffer(&buf,
                                                  "     LEFT JOIN pg_catalog.pg_language l ON l.oid = p.prolang\n");
 
-       /*
-        * we skip in/out funcs by excluding functions that take or return cstring
-        */
-       appendPQExpBuffer(&buf,
-                  "WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
-                                         "      AND p.proargtypes[0] IS DISTINCT FROM 'pg_catalog.cstring'::pg_catalog.regtype\n"
-                                         "      AND NOT p.proisagg\n");
+       appendPQExpBuffer(&buf, "WHERE NOT p.proisagg\n");
 
        if (!showSystem && !pattern)
                appendPQExpBuffer(&buf, "      AND n.nspname <> 'pg_catalog'\n"
@@ -643,7 +637,7 @@ objectDescription(const char *pattern, bool showSystem)
                                                  "n.nspname", "p.proname", NULL,
                                                  "pg_catalog.pg_function_is_visible(p.oid)");
 
-       /* Function descriptions (except in/outs for datatypes) */
+       /* Function descriptions */
        appendPQExpBuffer(&buf,
                                          "UNION ALL\n"
                                          "  SELECT p.oid as oid, p.tableoid as tableoid,\n"
@@ -652,11 +646,7 @@ objectDescription(const char *pattern, bool showSystem)
                                          "  CAST('%s' AS pg_catalog.text) as object\n"
                                          "  FROM pg_catalog.pg_proc p\n"
         "       LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
-
-                "  WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
-                                         "      AND (p.proargtypes[0] IS NULL\n"
-                                         "      OR   p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype)\n"
-                                         "      AND NOT p.proisagg\n",
+                                         "  WHERE NOT p.proisagg\n",
                                          gettext_noop("function"));
 
        if (!showSystem && !pattern)