1CREATE TEMP TABLE tmp (
2  node_id text,
3  hostname text,
4  port text,
5  status text,
6  pg_status text,
7  lb_weight text,
8  role text,
9  pg_role text,
10  select_cnt text,
11  load_balance_node text,
12  replication_delay text,
13  replication_state text,
14  replication_sync_state text,
15  last_status_change text,
16  mode text);
17
18INSERT INTO tmp VALUES
19('0',:dir,'11002','up','up','0.500000','primary','unknown','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'),
20('1',:dir,'11003','down','down','0.500000','standby','unknown','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'),
21('0',:dir,'11002','up','up','0.500000','main','main','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'),
22('1',:dir,'11003','down','down','0.500000','replica','replica','0','false','0','','','XXXX-XX-XX XX:XX:XX','r');
23
24SELECT node_id,hostname,port,status,pg_status,lb_weight,role,pg_role,select_cnt,load_balance_node,replication_delay,replication_state, replication_sync_state, last_status_change
25FROM tmp
26WHERE mode = :mode
27