Please find attached a tiny patch which adds a "Login" field to the \du command, displaying wether a role has the LOGIN privilege granted or not. I found this useful, since you have to query the system catalog directly to find out which role is permitted to login.

--
 Thanks

                   Bernd
Index: src/bin/psql/describe.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/describe.c,v
retrieving revision 1.159
diff -c -B -r1.159 describe.c
*** src/bin/psql/describe.c	22 Aug 2007 02:25:34 -0000	1.159
--- src/bin/psql/describe.c	13 Sep 2007 13:54:25 -0000
***************
*** 1575,1580 ****
--- 1575,1581 ----
  				"  CASE WHEN r.rolsuper THEN '%s' ELSE '%s' END AS \"%s\",\n"
  		   "  CASE WHEN r.rolcreaterole THEN '%s' ELSE '%s' END AS \"%s\",\n"
  			 "  CASE WHEN r.rolcreatedb THEN '%s' ELSE '%s' END AS \"%s\",\n"
+ 			 "  CASE WHEN r.rolcanlogin THEN '%s' ELSE '%s' END AS \"%s\",\n"
  		"  CASE WHEN r.rolconnlimit < 0 THEN CAST('%s' AS pg_catalog.text)\n"
  					  "       ELSE CAST(r.rolconnlimit AS pg_catalog.text)\n"
  					  "  END AS \"%s\", \n"
***************
*** 1583,1588 ****
--- 1584,1590 ----
  					  _("yes"), _("no"), _("Superuser"),
  					  _("yes"), _("no"), _("Create role"),
  					  _("yes"), _("no"), _("Create DB"),
+ 					  _("yes"), _("no"), _("Login"),
  					  _("no limit"), _("Connections"),
  					  _("Member of"));
  
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to