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

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

From
momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Log Message:
-----------
Have \dn+ show permissions and description for schemas.

Dennis Bjorklund

Modified Files:
--------------
    pgsql-server/doc/src/sgml/ref:
        psql-ref.sgml (r1.117 -> r1.118)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/doc/src/sgml/ref/psql-ref.sgml.diff?r1=1.117&r2=1.118)
    pgsql-server/src/bin/psql:
        command.c (r1.120 -> r1.121)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/psql/command.c.diff?r1=1.120&r2=1.121)
        describe.c (r1.101 -> r1.102)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/psql/describe.c.diff?r1=1.101&r2=1.102)
        describe.h (r1.24 -> r1.25)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/psql/describe.h.diff?r1=1.24&r2=1.25)
        help.c (r1.88 -> r1.89)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/psql/help.c.diff?r1=1.88&r2=1.89)

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

From
Peter Eisentraut
Date:
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.


Re: pgsql-server: Have \dn+ show permissions and description

From
Bruce Momjian
Date:
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

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

From
Peter Eisentraut
Date:
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.


Re: pgsql-server: Have \dn+ show permissions and description

From
Bruce Momjian
Date:
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

Re: pgsql-server: Have \dn+ show permissions and description

From
Christopher Kings-Lynne
Date:
> 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


Re: pgsql-server: Have \dn+ show permissions and description

From
Tom Lane
Date:
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