pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feeddoc sql-grant.html Synopsis error?
3+ messages / 3 participants
[nested] [flat]
* doc sql-grant.html Synopsis error?
@ 2023-04-08 12:58 jian he <jian.universality@gmail.com>
2023-04-08 13:07 ` Re: doc sql-grant.html Synopsis error? Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>
0 siblings, 1 reply; 3+ messages in thread
From: jian he @ 2023-04-08 12:58 UTC (permalink / raw)
To: pgsql-general list <pgsql-general@lists.postgresql.org>
Hi.
--work as intended.
grant ALL PRIVILEGES on FUNCTION pg_catalog.pg_reload_conf() to test;
grant ALL PRIVILEGES on FUNCTION pg_reload_conf() to test;
-------------errors. it should be work, or I interpret the doc the wrong
way?
GRANT ALL PRIVILEGES ON FUNCTION pg_reload_conf() IN SCHEMA pg_catalog TO
test;
GRANT ALL PRIVILEGES ON FUNCTION pg_catalog.pg_reload_conf() IN SCHEMA
pg_catalog TO test;
doc: https://www.postgresql.org/docs/current/sql-grant.html
GRANT { EXECUTE | ALL [ PRIVILEGES ] }
ON { { FUNCTION | PROCEDURE | ROUTINE } *routine_name* [ ( [ [
*argmode* ] [ *arg_name* ] *arg_type* [, ...] ] ) ] [, ...]
| ALL { FUNCTIONS | PROCEDURES | ROUTINES } IN SCHEMA
*schema_name* [, ...] }
TO *role_specification* [, ...] [ WITH GRANT OPTION ]
[ GRANTED BY *role_specification* ]
I am using postgres 16, but the grant function part does not change.
What did I miss?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: doc sql-grant.html Synopsis error?
2023-04-08 12:58 doc sql-grant.html Synopsis error? jian he <jian.universality@gmail.com>
@ 2023-04-08 13:07 ` Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>
2023-04-08 15:18 ` Re: doc sql-grant.html Synopsis error? Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 1 reply; 3+ messages in thread
From: Achilleas Mantzios @ 2023-04-08 13:07 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Στις 8/4/23 15:58, ο/η jian he έγραψε:
>
> Hi.
> --work as intended.
> grant ALL PRIVILEGES on FUNCTION pg_catalog.pg_reload_conf() to test;
> grant ALL PRIVILEGES on FUNCTION pg_reload_conf() to test;
>
> -------------errors. it should be work, or I interpret the doc the
> wrong way?
> GRANT ALL PRIVILEGES ON FUNCTION pg_reload_conf() IN SCHEMA pg_catalog
> TO test;
> GRANT ALL PRIVILEGES ON FUNCTION pg_catalog.pg_reload_conf() IN SCHEMA
> pg_catalog TO test;
>
> doc: https://www.postgresql.org/docs/current/sql-grant.html
> GRANT { EXECUTE | ALL [ PRIVILEGES ] }
> ON { { FUNCTION | PROCEDURE | ROUTINE }/|routine_name|/ [ ( [ [/|argmode|/ ] [/|arg_name|/ ]/|arg_type|/ [, ...] ] ) ] [, ...]
> | ALL { FUNCTIONS | PROCEDURES | ROUTINES } IN SCHEMA/|schema_name|/ [, ...] }
> TO/|role_specification|/ [, ...] [ WITH GRANT OPTION ]
> [ GRANTED BY/|role_specification|/ ]
> I am using postgres 16, but the grant function part does not change.
> What did I miss?
Hello, You missed the docs. The "IN SCHEMA" version always goes with ALL
FUNCTIONS in the beginning. What would be the point specifying
pg_catalog.pg_reload_conf() IN SCHEMA pg_catalog, i.e. giving the SCHEMA
twice ?
--
Achilleas Mantzios
IT DEV - HEAD
IT DEPT
Dynacom Tankers Mgmt
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: doc sql-grant.html Synopsis error?
2023-04-08 12:58 doc sql-grant.html Synopsis error? jian he <jian.universality@gmail.com>
2023-04-08 13:07 ` Re: doc sql-grant.html Synopsis error? Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>
@ 2023-04-08 15:18 ` Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Klaver @ 2023-04-08 15:18 UTC (permalink / raw)
To: Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>; pgsql-general@lists.postgresql.org
On 4/8/23 06:07, Achilleas Mantzios wrote:
> Στις 8/4/23 15:58, ο/η jian he έγραψε:
>>
>> Hi.
>> --work as intended.
>> grant ALL PRIVILEGES on FUNCTION pg_catalog.pg_reload_conf() to test;
>> grant ALL PRIVILEGES on FUNCTION pg_reload_conf() to test;
>>
>> -------------errors. it should be work, or I interpret the doc the
>> wrong way?
>> GRANT ALL PRIVILEGES ON FUNCTION pg_reload_conf() IN SCHEMA pg_catalog
>> TO test;
>> GRANT ALL PRIVILEGES ON FUNCTION pg_catalog.pg_reload_conf() IN SCHEMA
>> pg_catalog TO test;
>>
>> doc: https://www.postgresql.org/docs/current/sql-grant.html
>> GRANT { EXECUTE | ALL [ PRIVILEGES ] }
>> ON { { FUNCTION | PROCEDURE | ROUTINE }/|routine_name|/ [ ( [ [/|argmode|/ ] [/|arg_name|/ ]/|arg_type|/ [, ...] ] ) ] [, ...]
>> | ALL { FUNCTIONS | PROCEDURES | ROUTINES } IN SCHEMA/|schema_name|/ [, ...] }
>> TO/|role_specification|/ [, ...] [ WITH GRANT OPTION ]
>> [ GRANTED BY/|role_specification|/ ]
>> I am using postgres 16, but the grant function part does not change.
>> What did I miss?
>
> Hello, You missed the docs. The "IN SCHEMA" version always goes with ALL
> FUNCTIONS in the beginning. What would be the point specifying
> pg_catalog.pg_reload_conf() IN SCHEMA pg_catalog, i.e. giving the SCHEMA
> twice ?
To be a little clearer to use IN SCHEMA the command would be:
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA pg_catalog TO test;
Where ALL FUNCTIONS IN SCHEMA is a bulk operation over the functions in
the schema per the docs:
https://www.postgresql.org/docs/current/sql-grant.html
"There is also an option to grant privileges on all objects of the same
type within one or more schemas. This functionality is currently
supported only for tables, sequences, functions, and procedures. ALL
TABLES also affects views and foreign tables, just like the
specific-object GRANT command. ALL FUNCTIONS also affects aggregate and
window functions, but not procedures, again just like the
specific-object GRANT command. Use ALL ROUTINES to include procedures."
Since you are looking to GRANT to a specific function you need to schema
qualify the function name as IN SCHEMA is not available in that form of
the command.
>
> --
> Achilleas Mantzios
> IT DEV - HEAD
> IT DEPT
> Dynacom Tankers Mgmt
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-04-08 15:18 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-04-08 12:58 doc sql-grant.html Synopsis error? jian he <jian.universality@gmail.com>
2023-04-08 13:07 ` Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>
2023-04-08 15:18 ` Adrian Klaver <adrian.klaver@aklaver.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox