Attached is a patch that adds information about function volatility to
the output of psql's "\df+" slash command. I'll apply this to HEAD
tomorrow, barring any objections.

-Neil

Index: src/bin/psql/describe.c
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/bin/psql/describe.c,v
retrieving revision 1.155
diff -p -c -r1.155 describe.c
*** src/bin/psql/describe.c	19 Mar 2007 23:38:31 -0000	1.155
--- src/bin/psql/describe.c	26 Jun 2007 22:01:55 -0000
*************** describeFunctions(const char *pattern, b
*** 205,215 ****
  
  	if (verbose)
  		appendPQExpBuffer(&buf,
  						  ",\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"),
  						  _("Source code"), _("Description"));
  
  	if (!verbose)
--- 205,220 ----
  
  	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\"",
! 						  _("Volatility"), _("Owner"), _("Language"),
  						  _("Source code"), _("Description"));
  
  	if (!verbose)
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to