Skip site navigation (1) Skip section navigation (2)

Comments on roles and tablespaces for pg 8.2+

From: Erwin Brandstetter <brandstetter(at)falter(dot)at>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Comments on roles and tablespaces for pg 8.2+
Date: 2007-08-01 20:08:17
Message-ID: 46B0E831.9030601@falter.at (view raw or flat)
Thread:
Lists: pgadmin-hackers
Hi developers!

Testing pgAdmin III 1.8.0  Beta 2 (Jul 25 2007, rev: 6486). Client Win 
XP, host: Debian Etch / PG 8.2.4

pg 8.2 has added COMMENTs on two more objects: roles and tablespaces.
    http://www.postgresql.org/docs/8.2/static/sql-comment.html  (compare 
with:  http://www.postgresql.org/docs/8.1/static/sql-comment.html)

    COMMENT ON ROLE my_role IS 'Administration group for finance tables';
    COMMENT ON TABLESPACE my_tablespace IS 'Tablespace for indexes';

As I have to manage lots of users I find comments on roles especially 
useful. pgAdmin, however, does not yet display these in the SQL pane of 
the object browser. One might overwrite existing ones by accident, being 
mislead into thinking there were none.

There is even a "Comment" field in the properties dialogue for 
tablespaces, but it does not display existing comments and you cannot 
enter anything, either.
There is no "Comment" field in in the properties dialogue for roles, yet.

I would be content if the comments were shown in the SQL pane. Being 
able to edit them via properties dialogue would be a bonus, IMO.


The only new place for comments in pg 8.3 would be this one: (according 
to http://developer.postgresql.org/pgdocs/postgres/sql-comment.html)
    OPERATOR FAMILY /object_name/ USING /index_method
/Not sure whether that requires any changes to pgAdmin./
/

For reference:
psql (v 8.2.4) displays the comments. I demonstrate with "psql -E" to 
show the used SQL (German version):
There is still  \du+ or \dg+ for users / groups. Both display all roles 
these days (they should probably update the docs or, better yet, 
substitute \du and \dg with \dr ...)

event=# \du+
******** ANFRAGE *********
SELECT r.rolname AS "Rollenname",
  CASE WHEN r.rolsuper THEN 'ja' ELSE 'nein' END AS "Superuser",
  CASE WHEN r.rolcreaterole THEN 'ja' ELSE 'nein' END AS "Rolle erzeugen",
  CASE WHEN r.rolcreatedb THEN 'ja' ELSE 'nein' END AS "DB erzeugen",
  CASE WHEN r.rolconnlimit < 0 THEN CAST('keine Beschränkung' AS 
pg_catalog.text)
       ELSE CAST(r.rolconnlimit AS pg_catalog.text)
  END AS "Verbindungen",
  ARRAY(SELECT b.rolname FROM pg_catalog.pg_auth_members m JOIN 
pg_catalog.pg_roles b ON (m.roleid = b.oid) WHERE m.member = r.oid) as 
"Mitglied von"
, pg_catalog.shobj_description(r.oid, 'pg_authid') AS "Beschreibung"
FROM pg_catalog.pg_roles r
ORDER BY 1;
**************************

--  tablespaces:
event=# \db+
******** ANFRAGE *********
SELECT spcname AS "Name",
  pg_catalog.pg_get_userbyid(spcowner) AS "Eigentümer",
  spclocation AS "Pfad",
  spcacl as "Zugriffsrechte",
  pg_catalog.shobj_description(oid, 'pg_tablespace') AS "Beschreibung"
FROM pg_catalog.pg_tablespace
ORDER BY 1;
**************************


Regards
Erwin

Responses

pgadmin-hackers by date

Next:From: Guillaume LelargeDate: 2007-08-01 23:07:46
Subject: Re: I want to be a translator of Chinese (Simplified)
Previous:From: 李飞Date: 2007-08-01 17:33:38
Subject: I want to be a translator of Chinese (Simplified)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group