summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-04-10 12:22:10 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2023-04-10 12:22:10 -0400
commit26f36fe844880ff68dc28493bba9aced5aad0034 (patch)
tree3db7a871bec865bdc3d23aedebfb795d780585a0 /doc
parent6ff2e8cdd410f70057cfa6259ad395c1119aeb32 (diff)
downloadpostgresql-26f36fe844880ff68dc28493bba9aced5aad0034.tar.gz
Doc: avoid using pg_get_publication_tables() in an example.
pg_get_publication_tables() is undocumented because it's only meant as infrastructure for the pg_publication_tables system view. That being the case, we should use the view not the bare function in this sample query. Shi Yu Discussion: https://postgr.es/m/OSZPR01MB63107E83D07FEDEEABD83A23FD949@OSZPR01MB6310.jpnprd01.prod.outlook.com
Diffstat (limited to 'doc')
-rw-r--r--doc/src/sgml/ref/create_subscription.sgml14
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index 4c2db4c30d..71652fd918 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -496,12 +496,14 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
other subscriptions created on the publisher) try this SQL query:
<programlisting>
# substitute &lt;pub-names&gt; below with your publication name(s) to be queried
-SELECT DISTINCT N.nspname AS schemaname, C.relname AS tablename
-FROM pg_publication P,
- LATERAL pg_get_publication_tables(P.pubname) GPT
- JOIN pg_subscription_rel PS ON (GPT.relid = PS.srrelid),
- pg_class C JOIN pg_namespace N ON (N.oid = C.relnamespace)
-WHERE C.oid = GPT.relid AND P.pubname IN (&lt;pub-names&gt;);
+SELECT DISTINCT PT.schemaname, PT.tablename
+FROM pg_publication_tables PT,
+ pg_subscription_rel PS
+ JOIN pg_class C ON (C.oid = PS.srrelid)
+ JOIN pg_namespace N ON (N.oid = C.relnamespace)
+WHERE N.nspname = PT.schemaname AND
+ C.relname = PT.tablename AND
+ PT.pubname IN (&lt;pub-names&gt;);
</programlisting></para>
</refsect1>