If
class="parameter">pattern is specified, only
- functions whose names match the pattern are shown. If the
- form \df+ is used, additional information
- about each function, including security, volatility, language, source
- code and description, is shown. By default, only user-created
+ functions whose names match the pattern are shown.
+ By default, only user-created
objects are shown; supply a pattern or the S
modifier to include system objects.
+ If the form \df+ is used, additional information
+ about each function is shown, including security classification,
+ volatility, owner, language, source code and description.
- \do[S] [ pattern ]
+ \do[S+ ] [ pattern ]
- Lists operators with their operand and return types.
+ Lists operators with their operand and result types.
If pattern is
specified, only operators whose names match the pattern are listed.
- By default, only user-created objects are shown; supply a
+ By default, only user-created objects are shown; supply a
pattern or the S modifier to include system
objects.
+ If + is appended to the command name,
+ additional information about each operator is shown, currently just
+ the name of the underlying function.
success = listSchemas(pattern, show_verbose, show_system);
break;
case 'o':
- success = describeOperators(pattern, show_system);
+ success = describeOperators(pattern, show_verbose, show_ system);
break;
case 'O':
success = listCollations(pattern, show_verbose, show_system);
/* \do
+ * Describe operators
*/
bool
-describeOperators(const char *pattern, bool showSystem)
+describeOperators(const char *pattern, bool verbose, bool showSystem)
{
PQExpBufferData buf;
PGresult *res;
" o.oprname AS \"%s\",\n"
" CASE WHEN o.oprkind='l' THEN NULL ELSE pg_catalog.format_type(o.oprleft, NULL) END AS \"%s\",\n"
" CASE WHEN o.oprkind='r' THEN NULL ELSE pg_catalog.format_type(o.oprright, NULL) END AS \"%s\",\n"
- " pg_catalog.format_type(o.oprresult, NULL) AS \"%s\",\n"
- " coalesce(pg_catalog.obj_description(o.oid, 'pg_operator'),\n"
- " pg_catalog.obj_description(o.oprcode, 'pg_proc')) AS \"%s\"\n"
- "FROM pg_catalog.pg_operator o\n"
- " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = o.oprnamespace\n",
+ " pg_catalog.format_type(o.oprresult, NULL) AS \"%s\",\n",
gettext_noop("Schema"),
gettext_noop("Name"),
gettext_noop("Left arg type"),
gettext_noop("Right arg type"),
- gettext_noop("Result type"),
+ gettext_noop("Result type"));
+
+ if (verbose)
+ appendPQExpBuffer(&buf,
+ " o.oprcode AS \"%s\",\n",
+ gettext_noop("Function"));
+
+ appendPQExpBuffer(&buf,
+ " coalesce(pg_catalog.obj_description(o.oid, 'pg_operator'),\n"
+ " pg_catalog.obj_description(o.oprcode, 'pg_proc')) AS \"%s\"\n"
+ "FROM pg_catalog.pg_operator o\n"
+ " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = o.oprnamespace\n",
gettext_noop("Description"));
if (!showSystem && !pattern)
extern bool describeTypes(const char *pattern, bool verbose, bool showSystem);
/* \do */
-extern bool describeOperators(const char *pattern, bool showSystem);
+extern bool describeOperators(const char *pattern, bool verbose, bool showSystem);
/* \du, \dg */
extern bool describeRoles(const char *pattern, bool verbose);