Created
November 17, 2023 14:50
-
-
Save Charmatzis/f33f5a68e3477745a4dc2ba58989a247 to your computer and use it in GitHub Desktop.
pglogical monitor queries taken from https://cloud.google.com/alloydb/docs/omni/monitor-pglogical
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
name, | |
setting | |
from | |
pg_settings | |
where | |
name in ('wal_level', 'track_commit_timestamp', 'max_worker_processes', 'max_replication_slots', 'max_wal_senders ', 'shared_preload_libraries'); | |
SELECT name, | |
setting, | |
source, | |
short_desc | |
FROM pg_catalog.pg_settings | |
WHERE name LIKE '%pglogical%' | |
ORDER BY category, name; | |
SELECT name, | |
setting, | |
source, | |
short_desc | |
FROM pg_catalog.pg_settings | |
WHERE name IN ('wal_level', | |
'max_worker_processes', | |
'max_replication_slots', | |
'max_wal_senders', | |
'shared_preload_libraries', | |
'track_commit_timestamp') | |
ORDER BY name; | |
SELECT node_id, | |
if_nodeid AS node_id, | |
if_name AS node_name, | |
if_dsn AS dsn | |
FROM pglogical.node_interface | |
LEFT JOIN pglogical.local_node ON (node_id = if_nodeid AND node_local_interface = if_id) | |
ORDER BY node_name; | |
SELECT s.sub_name AS subscription_name, | |
n1.node_name AS origin_name, | |
n2.node_name AS target_name, | |
x.status, | |
sub_slot_name, | |
sub_replication_sets, | |
sub_forward_origins, | |
sub_apply_delay, | |
sub_force_text_transfer, | |
sub_enabled AS enabled | |
FROM pglogical.subscription s, | |
(SELECT subscription_name, status FROM pglogical.show_subscription_status()) AS x, | |
pglogical.node n1, | |
pglogical.node n2 | |
WHERE s.sub_origin = n1.node_id | |
AND s.sub_target = n2.node_id | |
AND s.sub_name = x.subscription_name | |
ORDER BY s.sub_name; | |
SELECT sync_nspname||'.'||sync_relname AS table_name, | |
sync_status, | |
sync_statuslsn | |
FROM pglogical.local_sync_status | |
WHERE sync_relname IS NOT NULL | |
ORDER BY table_name; | |
SELECT * FROM pglogical.show_subscription_table('test_sub_1','test_table_1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment