pgsql-server: Have \dn+ show permissions and description for schemas.

Started by Bruce Momjianalmost 22 years ago8 messagescomitters
Jump to latest
#1Bruce Momjian
bruce@momjian.us
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#1)
Re: pgsql-server: Have \dn+ show permissions and description for schemas.

Bruce Momjian wrote:

Log Message:
-----------
Have \dn+ show permissions and description for schemas.

Did we agree on this? It's now inconsistent with tables and other
objects.

#3Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#2)
Re: pgsql-server: Have \dn+ show permissions and description

Peter Eisentraut wrote:

Bruce Momjian wrote:

Log Message:
-----------
Have \dn+ show permissions and description for schemas.

Did we agree on this? It's now inconsistent with tables and other
objects.

No one disagreed that I remember. How are we inconsistent exactly?

-- 
  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
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#3)
Re: pgsql-server: Have \dn+ show permissions and description for schemas.

Bruce Momjian wrote:

Peter Eisentraut wrote:

Bruce Momjian wrote:

Log Message:
-----------
Have \dn+ show permissions and description for schemas.

Did we agree on this? It's now inconsistent with tables and other
objects.

No one disagreed that I remember. How are we inconsistent exactly?

Dennis asked for opinions about how to name the command. There were
other opinions offered. The patch was just an example, without a
decision on the name of the command.

The inconsistency is that there is a separate "show permissions" command
for tables, but for schemas it's now under "extra information". Now we
can't be sure where the permission information for the next object will
end up. That's not good.

#5Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#4)
Re: pgsql-server: Have \dn+ show permissions and description

Peter Eisentraut wrote:

Bruce Momjian wrote:

Peter Eisentraut wrote:

Bruce Momjian wrote:

Log Message:
-----------
Have \dn+ show permissions and description for schemas.

Did we agree on this? It's now inconsistent with tables and other
objects.

No one disagreed that I remember. How are we inconsistent exactly?

Dennis asked for opinions about how to name the command. There were
other opinions offered. The patch was just an example, without a
decision on the name of the command.

The inconsistency is that there is a separate "show permissions" command
for tables, but for schemas it's now under "extra information". Now we
can't be sure where the permission information for the next object will
end up. That's not good.

With \dp having a schema column, how would we display permissions there?

Access privileges for database "test"
Schema | Name | Type | Access privileges
--------+------+-------+-------------------
public | test | table |
(1 row)

I don't think it makes sense to add schema to \dp if it would not
normally appear in the \dp display.

I figured schema permissions were different enough from table that is
belonged under schema, no? Also, to me view/table/sequence are data
storage objects, while schemas seem different.

-- 
  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
#6Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Bruce Momjian (#5)
Re: pgsql-server: Have \dn+ show permissions and description

With \dp having a schema column, how would we display permissions there?

Access privileges for database "test"
Schema | Name | Type | Access privileges
--------+------+-------+-------------------
public | test | table |
(1 row)

I don't think it makes sense to add schema to \dp if it would not
normally appear in the \dp display.

I figured schema permissions were different enough from table that is
belonged under schema, no? Also, to me view/table/sequence are data
storage objects, while schemas seem different.

Don't forget \db for tablespaces as well - that should work the same as
\dn wrt permissions display.

Chris

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#5)
Re: pgsql-server: Have \dn+ show permissions and description

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Peter Eisentraut wrote:

The inconsistency is that there is a separate "show permissions" command
for tables, but for schemas it's now under "extra information". Now we
can't be sure where the permission information for the next object will
end up. That's not good.

With \dp having a schema column, how would we display permissions there?

IIRC Peter had suggested inventing a series of \zX commands to parallel
the \dX commands. I don't have a problem with that in the abstract, but
who's going to step up and do it exactly? The existence of \dp would
create a bit of a wart in the consistency of things anyway, so it's not
like we would have a solution that's both 100% self-consistent and 100%
upward compatible.

Personally I don't think that the \-command output has to be totally
consistent from version to version --- we've never intended it to be
machine-readable only person-readable. So I think the CVS-tip \dn+
behavior is okay until we get around to inventing \zX or adding
permissions to the other \d+ commands or whatever the long-term answer
turns out to be.

regards, tom lane

#8Bruce Momjian
bruce@momjian.us
In reply to: Christopher Kings-Lynne (#6)
Re: [COMMITTERS] pgsql-server: Have \dn+ show permissions and description

Christopher Kings-Lynne wrote:

With \dp having a schema column, how would we display permissions there?

Access privileges for database "test"
Schema | Name | Type | Access privileges
--------+------+-------+-------------------
public | test | table |
(1 row)

I don't think it makes sense to add schema to \dp if it would not
normally appear in the \dp display.

I figured schema permissions were different enough from table that is
belonged under schema, no? Also, to me view/table/sequence are data
storage objects, while schemas seem different.

Don't forget \db for tablespaces as well - that should work the same as
\dn wrt permissions display.

OK, done and applied:

test=> \db
List of tablespaces
Name | Owner | Location
------------+----------+----------
pg_default | postgres |
pg_global | postgres |
temp | postgres | /bjm/tmp
(3 rows)

test=> \db+
List of tablespaces
Name | Owner | Location | Access privileges
------------+----------+----------+-----------------------------------
pg_default | postgres | |
pg_global | postgres | |

Tablespaces, being global, don't have comments so I didn't do that part.

-- 
  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

Attachments:

/bjm/difftext/plainDownload+21-11