Re: psql missing feature: show permissions for functions - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: psql missing feature: show permissions for functions
Date
Msg-id 20040921011106.GA7013@dcc.uchile.cl
Whole thread Raw
In response to Re: psql missing feature: show permissions for functions  (Jorge Godoy <godoy@ieee.org>)
List pgsql-bugs
On Mon, Sep 20, 2004 at 07:35:58PM -0300, Jorge Godoy wrote:

> testbase=# SELECT proacl, proargtypes FROM pg_proc WHERE proname='to_ascii';
>     proacl     | proargtypes
> ---------------+-------------
>  {=X/postgres} |          25
>  {=X/postgres} |       25 19
>  {=X/postgres} |       25 23
> (3 rows)
>
> testbase=#
>
> Where can I find this '25', '19', '23', etc. name? :-)

Those are OIDs from the pg_type catalog.  The format_type(oid, integer)
function can give you the actual name, as in

alvherre=# SELECT proacl, proargtypes, format_type(proargtypes[0], 0),
format_type(proargtypes[1], 0) FROM pg_proc WHERE proname='to_ascii';
    proacl     | proargtypes | format_type | format_type
---------------+-------------+-------------+-------------
 {=X/alvherre} |          25 | text        | -
 {=X/alvherre} |       25 19 | text        | name
 {=X/alvherre} |       25 23 | text        | integer
(3 filas)


The second argument is the type's typmod (the 25 in varchar(25), for
instance).

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The ability to monopolize a planet is insignificant
next to the power of the source"

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Backend with closed connection at 99% CPU
Next
From: Bruce Momjian
Date:
Subject: Re: psql missing feature: show permissions for functions]