Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pl8IE-00031d-Ff for pgsql-general@arkaria.postgresql.org; Sat, 08 Apr 2023 13:07:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pl8IC-00064H-Dw for pgsql-general@arkaria.postgresql.org; Sat, 08 Apr 2023 13:07:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pl8IC-000648-37 for pgsql-general@lists.postgresql.org; Sat, 08 Apr 2023 13:07:44 +0000 Received: from cloud.gatewaynet.com ([185.90.37.94]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pl8I7-001dnT-J9 for pgsql-general@lists.postgresql.org; Sat, 08 Apr 2023 13:07:43 +0000 Content-Type: multipart/alternative; boundary="------------0tob3ZPRz0J3oE8rFnvglbsf" Message-ID: <00828709-45d1-f82d-e270-7c9d4d52373e@cloud.gatewaynet.com> Date: Sat, 8 Apr 2023 16:07:36 +0300 MIME-Version: 1.0 Subject: Re: doc sql-grant.html Synopsis error? Content-Language: en-US To: pgsql-general@lists.postgresql.org References: From: Achilleas Mantzios In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------0tob3ZPRz0J3oE8rFnvglbsf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Στις 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 --------------0tob3ZPRz0J3oE8rFnvglbsf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Στις 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;

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