mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
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
This commit is contained in:
parent
6ff2e8cdd4
commit
26f36fe844
@ -496,12 +496,14 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
|
|||||||
other subscriptions created on the publisher) try this SQL query:
|
other subscriptions created on the publisher) try this SQL query:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
# substitute <pub-names> below with your publication name(s) to be queried
|
# substitute <pub-names> below with your publication name(s) to be queried
|
||||||
SELECT DISTINCT N.nspname AS schemaname, C.relname AS tablename
|
SELECT DISTINCT PT.schemaname, PT.tablename
|
||||||
FROM pg_publication P,
|
FROM pg_publication_tables PT,
|
||||||
LATERAL pg_get_publication_tables(P.pubname) GPT
|
pg_subscription_rel PS
|
||||||
JOIN pg_subscription_rel PS ON (GPT.relid = PS.srrelid),
|
JOIN pg_class C ON (C.oid = PS.srrelid)
|
||||||
pg_class C JOIN pg_namespace N ON (N.oid = C.relnamespace)
|
JOIN pg_namespace N ON (N.oid = C.relnamespace)
|
||||||
WHERE C.oid = GPT.relid AND P.pubname IN (<pub-names>);
|
WHERE N.nspname = PT.schemaname AND
|
||||||
|
C.relname = PT.tablename AND
|
||||||
|
PT.pubname IN (<pub-names>);
|
||||||
</programlisting></para>
|
</programlisting></para>
|
||||||
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user