psql schema permissions
There is no way to show schema permissions in psql.
The alternatives are:
1) A new \dpn command
2) Extend \dp to also show rights for schemas, but then we need
an extra column to describe what kind of object it is, and it
would mess up the pattern stuff.
3) Do nothing and let people who want to see schema permissions
query the system table (select * from pg_namespace).
4) Since \dn only shows the name and the owner we can simply
add a permission column.
5) Some better way that is unknow to me
I've attached a patch for number 4) which I think is the best. Well, 5) is
better, but also harder to implement.
--
/Dennis Bj�rklund
Attachments:
psql_show_schema_perms.txttext/plain; name=psql_show_schema_perms.txtDownload+7-7
On Wed, 30 Jun 2004, Dennis Bjorklund wrote:
There is no way to show schema permissions in psql.
4) Since \dn only shows the name and the owner we can simply
add a permission column.
Someone requested that \dn+ also show the comment for the schema, if
you're messing around in that area.
Kris Jurka
On Wed, 30 Jun 2004, Kris Jurka wrote:
There is no way to show schema permissions in psql.
4) Since \dn only shows the name and the owner we can simply
add a permission column.Someone requested that \dn+ also show the comment for the schema, if
you're messing around in that area.
One could put both the permissions and the comment in a \dn+ command.
In general I'm not sure what is the best method. Adding more and more \x
commands is not going to work forever. Maybe we should introduce more
long commands and have \x commands for the most common things.
--
/Dennis Bj�rklund
Am Mittwoch, 30. Juni 2004 15:18 schrieb Dennis Bjorklund:
There is no way to show schema permissions in psql.
You could extend \z (don't know where that name came from) so that \zX show
the permissions for things that \dX displays.
On Fri, 2 Jul 2004, Peter Eisentraut wrote:
You could extend \z (don't know where that name came from) so that \zX show
the permissions for things that \dX displays.
Yes, that was number 1) on the list
1) A new \dpn command
\dp and \z is the same thing. Any solution works for me. The main reason I
need it is so I can help people on irc to debug their problems. It's
easier to get them to run a psql command then to get them to query the
system tables.
The only problem with all new features of pg is that we get more and more
\x commands. Soon we will have all permutations of 2 letters.
--
/Dennis Bj�rklund
Dennis Bjorklund wrote:
There is no way to show schema permissions in psql.
The alternatives are:
1) A new \dpn command
2) Extend \dp to also show rights for schemas, but then we need
an extra column to describe what kind of object it is, and it
would mess up the pattern stuff.3) Do nothing and let people who want to see schema permissions
query the system table (select * from pg_namespace).4) Since \dn only shows the name and the owner we can simply
add a permission column.5) Some better way that is unknow to me
I've attached a patch for number 4) which I think is the best. Well, 5) is
better, but also harder to implement.
I have applied a modified version of your patch, attached. It makes
\dn+ show schema permissions and descriptions. (Idea from Tom.)
I don't think \dp makes sense because it is for data containers, not for
something like schemas. In fact the big issue is that \dp with no arg
would make no sense if it displayed schemas along with tables/sequences:
Access privileges for database "test"
Schema | Name | Type | Access privileges
--------+-------+-------+-------------------
public | test | table |
public | test2 | table |
public | test3 | table |
(3 rows)
It seems much more logical to add the info to \dn+:
test=> \dn
List of schemas
Name | Owner
--------------------+----------
information_schema | postgres
pg_catalog | postgres
pg_toast | postgres
public | postgres
(4 rows)
test=> \dn+
List of schemas
Name | Owner | Access privileges | Description
--------------------+----------+-------------------------------------+----------------------------------
information_schema | postgres | {postgres=UC/postgres,=U/postgres} |
pg_catalog | postgres | {postgres=UC/postgres,=U/postgres} | System catalog schema
pg_toast | postgres | | Reserved schema for TOAST tables
public | postgres | {postgres=UC/postgres,=UC/postgres} | I am public
(4 rows)
A little wide, but I don't see a better solution for this.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073