mirror of https://github.com/citusdata/citus.git
Add citus_nodes view
parent
a4040ba5da
commit
e822d6c9e5
|
@ -50,3 +50,4 @@ DROP VIEW IF EXISTS pg_catalog.citus_lock_waits;
|
||||||
#include "udfs/citus_is_primary_node/13.1-1.sql"
|
#include "udfs/citus_is_primary_node/13.1-1.sql"
|
||||||
#include "udfs/citus_stat_counters/13.1-1.sql"
|
#include "udfs/citus_stat_counters/13.1-1.sql"
|
||||||
#include "udfs/citus_stat_counters_reset/13.1-1.sql"
|
#include "udfs/citus_stat_counters_reset/13.1-1.sql"
|
||||||
|
#include "udfs/citus_nodes/13.1-1.sql"
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
SET search_path = 'pg_catalog';
|
||||||
|
DROP VIEW IF EXISTS pg_catalog.citus_nodes;
|
||||||
|
|
||||||
|
CREATE OR REPLACE VIEW citus.citus_nodes AS
|
||||||
|
SELECT
|
||||||
|
nodename,
|
||||||
|
nodeport,
|
||||||
|
CASE
|
||||||
|
WHEN groupid = 0 THEN 'coordinator'
|
||||||
|
ELSE 'worker'
|
||||||
|
END AS role,
|
||||||
|
isactive AS active
|
||||||
|
FROM pg_dist_node;
|
||||||
|
|
||||||
|
ALTER VIEW citus.citus_nodes SET SCHEMA pg_catalog;
|
||||||
|
GRANT SELECT ON pg_catalog.citus_nodes TO PUBLIC;
|
||||||
|
|
||||||
|
RESET search_path;
|
|
@ -0,0 +1,18 @@
|
||||||
|
SET search_path = 'pg_catalog';
|
||||||
|
DROP VIEW IF EXISTS pg_catalog.citus_nodes;
|
||||||
|
|
||||||
|
CREATE OR REPLACE VIEW citus.citus_nodes AS
|
||||||
|
SELECT
|
||||||
|
nodename,
|
||||||
|
nodeport,
|
||||||
|
CASE
|
||||||
|
WHEN groupid = 0 THEN 'coordinator'
|
||||||
|
ELSE 'worker'
|
||||||
|
END AS role,
|
||||||
|
isactive AS active
|
||||||
|
FROM pg_dist_node;
|
||||||
|
|
||||||
|
ALTER VIEW citus.citus_nodes SET SCHEMA pg_catalog;
|
||||||
|
GRANT SELECT ON pg_catalog.citus_nodes TO PUBLIC;
|
||||||
|
|
||||||
|
RESET search_path;
|
Loading…
Reference in New Issue