]> granicus.if.org Git - postgresql/commitdiff
Add the function's volatility to the output of psql's \df+ command.
authorNeil Conway <neilc@samurai.com>
Thu, 28 Jun 2007 06:40:16 +0000 (06:40 +0000)
committerNeil Conway <neilc@samurai.com>
Thu, 28 Jun 2007 06:40:16 +0000 (06:40 +0000)
Update the psql reference page accordingly.

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

index 49570be89088c2ad59f7ad5a9eabbf8ac15bb3fb..7da2f4f45614a6e788a75830501ebc8e3fd74437 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.191 2007/05/03 15:47:48 alvherre Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.192 2007/06/28 06:40:16 neilc Exp $
 PostgreSQL documentation
 -->
 
@@ -976,7 +976,7 @@ testdb=&gt;
         class="parameter">pattern</replaceable>
         is specified, only functions whose names match the pattern are shown.
         If the form <literal>\df+</literal> is used, additional information about
-        each function, including language and description, is shown.
+        each function, including volatility, language, source code and description, is shown.
         </para>
 
         <note>
index 13d3be678e84f6a22c9d5fb2c30004321ff4d6cd..041a1c14b63f35999ee4e891263fe6aea3df8c29 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000-2007, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.155 2007/03/19 23:38:31 wieck Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.156 2007/06/28 06:40:16 neilc Exp $
  */
 #include "postgres_fe.h"
 #include "describe.h"
@@ -205,11 +205,16 @@ describeFunctions(const char *pattern, bool verbose)
 
        if (verbose)
                appendPQExpBuffer(&buf,
+                                                 ",\n CASE\n"
+                                                 "  WHEN p.provolatile = 'i' THEN 'immutable'\n"
+                                                 "  WHEN p.provolatile = 's' THEN 'stable'\n"
+                                                 "  WHEN p.provolatile = 'v' THEN 'volatile'\n"
+                                                 "END as \"%s\""
                                                  ",\n  r.rolname as \"%s\",\n"
                                                  "  l.lanname as \"%s\",\n"
                                                  "  p.prosrc as \"%s\",\n"
                                  "  pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"",
-                                                 _("Owner"), _("Language"),
+                                                 _("Volatility"), _("Owner"), _("Language"),
                                                  _("Source code"), _("Description"));
 
        if (!verbose)