Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 26f36fe

Browse files
committed
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
1 parent 6ff2e8c commit 26f36fe

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doc/src/sgml/ref/create_subscription.sgml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,14 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
496496
other subscriptions created on the publisher) try this SQL query:
497497
<programlisting>
498498
# substitute &lt;pub-names&gt; below with your publication name(s) to be queried
499-
SELECT DISTINCT N.nspname AS schemaname, C.relname AS tablename
500-
FROM pg_publication P,
501-
LATERAL pg_get_publication_tables(P.pubname) GPT
502-
JOIN pg_subscription_rel PS ON (GPT.relid = PS.srrelid),
503-
pg_class C JOIN pg_namespace N ON (N.oid = C.relnamespace)
504-
WHERE C.oid = GPT.relid AND P.pubname IN (&lt;pub-names&gt;);
499+
SELECT DISTINCT PT.schemaname, PT.tablename
500+
FROM pg_publication_tables PT,
501+
pg_subscription_rel PS
502+
JOIN pg_class C ON (C.oid = PS.srrelid)
503+
JOIN pg_namespace N ON (N.oid = C.relnamespace)
504+
WHERE N.nspname = PT.schemaname AND
505+
C.relname = PT.tablename AND
506+
PT.pubname IN (&lt;pub-names&gt;);
505507
</programlisting></para>
506508

507509
</refsect1>

0 commit comments

Comments
 (0)