Patch: doc for pg_logical_emit_message()

Started by Matsumura, Ryoover 6 years ago7 messages
#1Matsumura, Ryo
matsumura.ryo@jp.fujitsu.com
1 attachment(s)

Hi, Hackers

pg_logical_emit_message() can be used by any user,
but the following document says that it can be used by only superuser.

Table 9.88. Replication SQL Functions
Use of these functions is restricted to superusers.

I think that pg_logicl_emit_message() should be used by any user.
Therefore, I attach the document patch.

Ryo
Matsumura

Attachments:

pg_logical_emit_message_doc.patchapplication/octet-stream; name=pg_logical_emit_message_doc.patchDownload
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 6211ff3..aefbf06 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -20336,7 +20336,8 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
     <xref linkend="streaming-replication-slots"/>, and
     <xref linkend="replication-origins"/>
     for information about the underlying features.  Use of these
-    functions is restricted to superusers.
+    functions is restricted to superusers except for
+	<function>pg_logical_emit_message</function>.
    </para>
 
    <para>
#2Fujii Masao
masao.fujii@gmail.com
In reply to: Matsumura, Ryo (#1)
Re: Patch: doc for pg_logical_emit_message()

On Fri, Apr 19, 2019 at 3:21 PM Matsumura, Ryo
<matsumura.ryo@jp.fujitsu.com> wrote:

Hi, Hackers

pg_logical_emit_message() can be used by any user,
but the following document says that it can be used by only superuser.

Table 9.88. Replication SQL Functions
Use of these functions is restricted to superusers.

I think that pg_logicl_emit_message() should be used by any user.
Therefore, I attach the document patch.

Thanks for the patch!

Use of not only pg_logical_emit_message() but also other replication
functions in Table 9.88 is not restricted to superuser. For example,
replication role can execute pg_create_physical_replication_slot().
So I think that the patch should fix also the description for those
replication functions. Thought?

Regards,

--
Fujii Masao

#3Matsumura, Ryo
matsumura.ryo@jp.fujitsu.com
In reply to: Fujii Masao (#2)
1 attachment(s)
RE: Patch: doc for pg_logical_emit_message()

On Tue. Apr. 23, 2019 at 02:59 AM Masao, Fujii
<masao.fujii@gmail.com> wrote:

Thank you for the comment.

So I think that the patch should fix also the description for those
replication functions. Thought?

I think so too.
I attach a new patch.

Regards
Ryo Matsumura

Attachments:

replication_functions_doc.patchapplication/octet-stream; name=replication_functions_doc.patchDownload
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index bae7df1..f6bf798 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -20337,8 +20337,10 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
     See <xref linkend="streaming-replication"/>,
     <xref linkend="streaming-replication-slots"/>, and
     <xref linkend="replication-origins"/>
-    for information about the underlying features.  Use of these
-    functions is restricted to superusers.
+    for information about the underlying features.
+    Use of functions for replication origin is restricted to superusers.
+    Use of functions for replication slot is restricted to superusers and replication roles.
+    Only <function>pg_logical_emit_message</function> can be used by any users.
    </para>
 
    <para>
#4Fujii Masao
masao.fujii@gmail.com
In reply to: Matsumura, Ryo (#3)
Re: Patch: doc for pg_logical_emit_message()

On Wed, Apr 24, 2019 at 11:12 AM Matsumura, Ryo
<matsumura.ryo@jp.fujitsu.com> wrote:

On Tue. Apr. 23, 2019 at 02:59 AM Masao, Fujii
<masao.fujii@gmail.com> wrote:

Thank you for the comment.

So I think that the patch should fix also the description for those
replication functions. Thought?

I think so too.
I attach a new patch.

Thanks for updating the patch!

+    Use of functions for replication origin is restricted to superusers.
+    Use of functions for replication slot is restricted to superusers
and replication roles.

"replication role" is a bit confusing. For example, we have
"replication role" related to session_replication_role. So
I think it's better to use something like "users having
<literal>REPLICATION</literal> privilege".

+ Only <function>pg_logical_emit_message</function> can be used by any users.

Not any user, I think. For example, what about a user not having
EXECUTE privilege on pg_logical_emit_message function?
I don't think that this description only for pg_logical_emit_message
is necessary.

Regards,

--
Fujii Masao

#5Matsumura, Ryo
matsumura.ryo@jp.fujitsu.com
In reply to: Fujii Masao (#4)
1 attachment(s)
RE: Patch: doc for pg_logical_emit_message()

On Wed. Apr. 24, 2019 at 11:40 PM Masao, Fujii
<masao.fujii@gmail.com> wrote:

Thank you for the comment.
I understand about REPLICATION privilege and notice my unecessary words.
I update the patch.

Regards
Ryo Matsumura

Attachments:

pg_logical_emit_message_doc_v1_2.patchapplication/octet-stream; name=pg_logical_emit_message_doc_v1_2.patchDownload
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index bae7df1..05f3bbf 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -20337,8 +20337,10 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
     See <xref linkend="streaming-replication"/>,
     <xref linkend="streaming-replication-slots"/>, and
     <xref linkend="replication-origins"/>
-    for information about the underlying features.  Use of these
-    functions is restricted to superusers.
+    for information about the underlying features.
+    Use of functions for replication origin is restricted to superusers.
+    Use of functions for replication slot is restricted to superusers
+    and users having <literal>REPLICATION</literal> privilege.
    </para>
 
    <para>
#6Fujii Masao
masao.fujii@gmail.com
In reply to: Matsumura, Ryo (#5)
Re: Patch: doc for pg_logical_emit_message()

On Fri, Apr 26, 2019 at 10:52 AM Matsumura, Ryo
<matsumura.ryo@jp.fujitsu.com> wrote:

On Wed. Apr. 24, 2019 at 11:40 PM Masao, Fujii
<masao.fujii@gmail.com> wrote:

Thank you for the comment.
I understand about REPLICATION privilege and notice my unecessary words.
I update the patch.

Thanks! Pushed.

Regards,

--
Fujii Masao

#7Matsumura, Ryo
matsumura.ryo@jp.fujitsu.com
In reply to: Fujii Masao (#6)
RE: Patch: doc for pg_logical_emit_message()

On Thu. May. 9, 2019 at 01:48 AM Masao, Fujii
<masao.fujii@gmail.com> wrote:

Thanks! Pushed.

Thank you.

Regards
Ryo Matsumura