change output of \dp

Started by Euler Taveira de Oliveiraover 22 years ago10 messagespatches
Jump to latest

Hi,

I just noticed that \dp outputs "Table" to indicate relations (tables, sequences and views) instead of "Relation" or "Name". This patch just correct it, using "Name" and attaching its "Type".

Without the patch:

teste=# \d
List of relations
Schema | Name | Type | Owner
--------+--------+----------+-------
public | ab | sequence | euler
public | foo | table | euler
public | foobar | view | euler
public | teste | table | euler
(4 rows)

teste=# \dp
Access privileges for database "teste"
Schema | Table | Access privileges
--------+--------+---------------------------------------------
public | ab | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
public | foo | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
public | foobar |
public | teste | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
(4 rows)

And with the patch:

teste=# \dp
Access privileges for database "teste"
Schema | Name | Type | Access privileges
--------+--------+----------+---------------------------------------------
public | ab | sequence | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
public | foo | table | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
public | foobar | view |
public | teste | table | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
(4 rows)

Please apply it under HEAD, and if it's convenient, put it under 7_4 Branch.

Regards,

--
Euler Taveira de Oliveira
euler (at) ufgnet.ufg.br
Desenvolvedor Web e Administrador de Sistemas
UFGNet - Universidade Federal de Goiás

Attachments:

dp.patchapplication/octet-stream; name=dp.patchDownload+3-2
#2Neil Conway
neilc@samurai.com
In reply to: Euler Taveira de Oliveira (#1)
Re: change output of \dp

Euler Taveira de Oliveira <euler@ufgnet.ufg.br> writes:

I just noticed that \dp outputs "Table" to indicate relations
(tables, sequences and views) instead of "Relation" or "Name". This
patch just correct it, using "Name" and attaching its "Type".

Looks good to me.

Please apply it under HEAD, and if it's convenient, put it under 7_4
Branch.

This is appropriate for HEAD, but I don't see any need to apply it to
7.4: it is just a cosmetic fix.

-Neil

#3Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#2)
Re: change output of \dp

Neil Conway wrote:

Euler Taveira de Oliveira <euler@ufgnet.ufg.br> writes:

I just noticed that \dp outputs "Table" to indicate relations
(tables, sequences and views) instead of "Relation" or "Name". This
patch just correct it, using "Name" and attaching its "Type".

Looks good to me.

Please apply it under HEAD, and if it's convenient, put it under 7_4
Branch.

This is appropriate for HEAD, but I don't see any need to apply it to
7.4: it is just a cosmetic fix.

Agreed.

-- 
  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
In reply to: Euler Taveira de Oliveira (#1)
Re: change output of \dp

Hi,

I just forgot the documentation patch. It's attached.

Regards,

--
Euler Taveira de Oliveira
euler (at) ufgnet.ufg.br
Desenvolvedor Web e Administrador de Sistemas
UFGNet - Universidade Federal de Goiás

Attachments:

dp_doc.patchapplication/octet-stream; name=dp_doc.patchDownload+4-4
#5Peter Eisentraut
peter_e@gmx.net
In reply to: Euler Taveira de Oliveira (#1)
Re: change output of \dp

Euler Taveira de Oliveira wrote:

I just noticed that \dp outputs "Table" to indicate relations
(tables, sequences and views) instead of "Relation" or "Name". This
patch just correct it, using "Name" and attaching its "Type".

Maybe we should think of a more general solution. For example, there is
still not any way to show the privileges of functions and other
objects.

In reply to: Peter Eisentraut (#5)
Re: change output of \dp

Hi,

I just noticed that \dp outputs "Table" to indicate relations
(tables, sequences and views) instead of "Relation" or "Name". This
patch just correct it, using "Name" and attaching its "Type".

Maybe we should think of a more general solution. For example, there is
still not any way to show the privileges of functions and other
objects.

I could do it, if nobody objects.

--
Euler Taveira de Oliveira
euler (at) ufgnet.ufg.br
Desenvolvedor Web e Administrador de Sistemas
UFGNet - Universidade Federal de Goiás

#7Bruce Momjian
bruce@momjian.us
In reply to: Euler Taveira de Oliveira (#6)
Re: change output of \dp

Euler Taveira de Oliveira wrote:

Hi,

I just noticed that \dp outputs "Table" to indicate relations
(tables, sequences and views) instead of "Relation" or "Name". This
patch just correct it, using "Name" and attaching its "Type".

Maybe we should think of a more general solution. For example, there is
still not any way to show the privileges of functions and other
objects.

I could do it, if nobody objects.

Sounds good. Do you want your original patch applied?

-- 
  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
In reply to: Bruce Momjian (#7)
Re: change output of \dp

Hi Bruce,

Sounds good. Do you want your original patch applied?

Sorry for the delay, i just redo the patch and change some documentation. Please apply the attached patch.
I will change the discussion for -hackers about some ideas to improve access privileges output.

Regards,

--
Euler Taveira de Oliveira
euler (at) ufgnet.ufg.br
Desenvolvedor Web e Administrador de Sistemas
UFGNet - Universidade Federal de Goiás

Attachments:

dp.patchapplication/octet-stream; name=dp.patchDownload+23-22
#9Bruce Momjian
bruce@momjian.us
In reply to: Euler Taveira de Oliveira (#1)
Re: change output of \dp

Newest version of patch applied. Thanks.

Handles views and sequences.

---------------------------------------------------------------------------

Euler Taveira de Oliveira wrote:

Hi,

I just noticed that \dp outputs "Table" to indicate relations (tables, sequences and views) instead of "Relation" or "Name". This patch just correct it, using "Name" and attaching its "Type".

Without the patch:

teste=# \d
List of relations
Schema | Name | Type | Owner
--------+--------+----------+-------
public | ab | sequence | euler
public | foo | table | euler
public | foobar | view | euler
public | teste | table | euler
(4 rows)

teste=# \dp
Access privileges for database "teste"
Schema | Table | Access privileges
--------+--------+---------------------------------------------
public | ab | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
public | foo | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
public | foobar |
public | teste | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
(4 rows)

And with the patch:

teste=# \dp
Access privileges for database "teste"
Schema | Name | Type | Access privileges
--------+--------+----------+---------------------------------------------
public | ab | sequence | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
public | foo | table | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
public | foobar | view |
public | teste | table | {euler=a*r*w*d*R*x*t*/euler,teste=ar/euler}
(4 rows)

Please apply it under HEAD, and if it's convenient, put it under 7_4 Branch.

Regards,

--
Euler Taveira de Oliveira
euler (at) ufgnet.ufg.br
Desenvolvedor Web e Administrador de Sistemas
UFGNet - Universidade Federal de Goi?s

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 
  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
#10Bruce Momjian
bruce@momjian.us
In reply to: Euler Taveira de Oliveira (#8)
Re: change output of \dp

This is the one applied.

---------------------------------------------------------------------------

Euler Taveira de Oliveira wrote:

Hi Bruce,

Sounds good. Do you want your original patch applied?

Sorry for the delay, i just redo the patch and change some documentation. Please apply the attached patch.
I will change the discussion for -hackers about some ideas to improve access privileges output.

Regards,

--
Euler Taveira de Oliveira
euler (at) ufgnet.ufg.br
Desenvolvedor Web e Administrador de Sistemas
UFGNet - Universidade Federal de Goi?s

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

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