Added support for Logical Replication. Fixes #5912

This commit is contained in:
Pradip Parkale
2021-02-01 15:12:43 +05:30
committed by Akshay Joshi
parent 179bac3fd0
commit bf56a6723b
87 changed files with 5793 additions and 15 deletions

View File

@@ -320,6 +320,24 @@ FROM (
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['publication'] %}
SELECT 'publication'::text AS obj_type, pubname AS obj_name, ':publication.'||pub.oid||':/' || pubname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['publication'] }} AS show_node, NULL AS other_info
FROM pg_publication pub
{% endif %}
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['subscription'] %}
SELECT 'subscription'::text AS obj_type, subname AS obj_name, ':subscription.'||pub.oid||':/' || subname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['subscription'] }} AS show_node, NULL AS other_info
FROM pg_subscription pub
{% endif %}
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['language'] %}
SELECT 'language'::text AS obj_type, lanname AS obj_name, ':language.'||lan.oid||':/' || lanname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['language'] }} AS show_node, NULL AS other_info

View File

@@ -337,6 +337,24 @@ FROM (
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['publication'] %}
SELECT 'publication'::text AS obj_type, pubname AS obj_name, ':publication.'||pub.oid||':/' || pubname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['publication'] }} AS show_node, NULL AS other_info
FROM pg_publication pub
{% endif %}
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['subscription'] %}
SELECT 'subscription'::text AS obj_type, subname AS obj_name, ':subscription.'||pub.oid||':/' || subname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['subscription'] }} AS show_node, NULL AS other_info
FROM pg_subscription pub
{% endif %}
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['language'] %}
SELECT 'language'::text AS obj_type, lanname AS obj_name, ':language.'||lan.oid||':/' || lanname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['language'] }} AS show_node, NULL AS other_info

View File

@@ -361,6 +361,25 @@ FROM (
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['publication'] %}
SELECT 'publication'::text AS obj_type, pubname AS obj_name, ':publication.'||pub.oid||':/' || pubname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['publication'] }} AS show_node, NULL AS other_info
FROM pg_publication pub
{% endif %}
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['subscription'] %}
SELECT 'subscription'::text AS obj_type, subname AS obj_name, ':subscription.'||pub.oid||':/' || subname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['subscription'] }} AS show_node, NULL AS other_info
FROM pg_subscription pub
{% endif %}
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['language'] %}
SELECT 'language'::text AS obj_type, lanname AS obj_name, ':language.'||lan.oid||':/' || lanname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['language'] }} AS show_node, NULL AS other_info

View File

@@ -368,6 +368,25 @@ FROM (
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['publication'] %}
SELECT 'publication'::text AS obj_type, pubname AS obj_name, ':publication.'||pub.oid||':/' || pubname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['publication'] }} AS show_node, NULL AS other_info
FROM pg_publication pub
{% endif %}
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['subscription'] %}
SELECT 'subscription'::text AS obj_type, subname AS obj_name, ':subscription.'||pub.oid||':/' || subname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['subscription'] }} AS show_node, NULL AS other_info
FROM pg_subscription pub
{% endif %}
{% if all_obj %}
UNION
{% endif %}
{% if all_obj or obj_type in ['language'] %}
SELECT 'language'::text AS obj_type, lanname AS obj_name, ':language.'||lan.oid||':/' || lanname AS obj_path, ''::text AS schema_name,
{{ show_node_prefs['language'] }} AS show_node, NULL AS other_info

View File

@@ -43,7 +43,8 @@ class SearchObjectsHelper:
'trigger_function', 'fts_template', 'collation', 'view', 'mview',
'fts_configuration', 'extension', 'language',
'event_trigger', 'foreign_server', 'user_mapping',
'foreign_data_wrapper', 'row_security_policy'
'foreign_data_wrapper', 'row_security_policy',
'publication', 'subscription'
] if node_types is None else node_types
@property