target_role definition clarification
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/12/sql-alterdefaultprivileges.html Description: The documentation on ALTER DEFAULT PRIVILEGES currently defines the parameter target_role like this: > The name of an existing role of which the current role is a member. If FOR ROLE is omitted, the current role is assumed. To be honest, this didn't help me to understand the purpose of the FOR ROLE clause. And the rest of the section doesn't really explain it, either. Also, the first part doesn't seem to be true. I mean, as user postgres, something like this succeeds: ``` > ALTER DEFAULT PRIVILEGES FOR ROLE juser IN SCHEMA public GRANT select ON TABLES TO backenduser; ALTER DEFAULT PRIVILEGES ``` Seems like a contradiction to the first sentence because user postgres (although it's a superuser) isn't a member of role juser. What I expected from that section is an explanation of the FOR ROLE clause. My current understanding is this: default privileges definitions are bound to one or multiple roles. That means that only when the FOR ROLE role(s) create(s) a specified object then the specified GRANT is automatically applied to it. Other roles aren't affected by that default privileges definition then.
Fix the example in the document of file-fdw
Although csvlog has the leader_pid field, the document of file-fdw that uses csvlog as an example does not reflect this fact. Concretely, the DDL for table definition does not have the leader_pid field. This patch fixes the DDL in the document of file-fdw. Regards, Yuta Katsuragidiff --git a/doc/src/sgml/file-fdw.sgml b/doc/src/sgml/file-fdw.sgml index eefc6e7e5b..8831f5911f 100644 --- a/doc/src/sgml/file-fdw.sgml +++ b/doc/src/sgml/file-fdw.sgml @@ -265,7 +265,8 @@ CREATE FOREIGN TABLE pglog ( query_pos integer, location text, application_name text, - backend_type text + backend_type text, + leader_pid integer ) SERVER pglog OPTIONS ( filename 'log/pglog.csv', format 'csv' );
Re: Fix the example in the document of file-fdw
On 2020/09/14 11:19, btkatsuragiyu wrote: Although csvlog has the leader_pid field, the document of file-fdw that uses csvlog as an example does not reflect this fact. Concretely, the DDL for table definition does not have the leader_pid field. This seems an oversight of commit b8fdee7d0c. This patch fixes the DDL in the document of file-fdw. Thanks for the patch! LGTM. I will commit it. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION
Re: Fix the example in the document of file-fdw
On Mon, Sep 14, 2020 at 11:33:23AM +0900, Fujii Masao wrote: > On 2020/09/14 11:19, btkatsuragiyu wrote: >> Although csvlog has the leader_pid field, the document of file-fdw >> that uses csvlog as an example does not reflect this fact. >> Concretely, the DDL for table definition does not have the leader_pid field. > > This seems an oversight of commit b8fdee7d0c. Dammit, I thought that I had all the places for that stuff done. The patch looks fine to me. >> This patch fixes the DDL in the document of file-fdw. > > Thanks for the patch! LGTM. I will commit it. Hmm. Instead of keeping a copy-paste of the same table in both config.sgml and file-fdw.sgml, why not having only one? It seems to me that we could just have the file_fdw doc refer to the main configuration, and it is not difficult to guess how the CREATE TABLE query needs to be changed to map with foreign table. -- Michael signature.asc Description: PGP signature