--- /dev/null
+CREATE TEMP TABLE tmp (
+ node_id text,
+ hostname text,
+ port text,
+ status text,
+ lb_weight text,
+ role text,
+ mode text);
+
+INSERT INTO tmp VALUES
+('0',:dir,'11002','2','0.500000','primary','s'),
+('1',:dir,'11003','3','0.500000','standby','s'),
+('0',:dir,'11002','2','0.500000','master','r'),
+('1',:dir,'11003','3','0.500000','slave','r');
+
+SELECT node_id,hostname,port,status,lb_weight,role
+FROM tmp
+WHERE mode = :mode
+++ /dev/null
- node_id | hostname | port | status | lb_weight | role
----------+----------+-------+--------+-----------+--------
- 0 | /tmp | 11000 | 2 | 0.500000 | master
- 1 | /tmp | 11001 | 3 | 0.500000 | slave
-(2 rows)
-
+++ /dev/null
- node_id | hostname | port | status | lb_weight | role
----------+----------+-------+--------+-----------+---------
- 0 | /tmp | 11000 | 2 | 0.500000 | primary
- 1 | /tmp | 11001 | 3 | 0.500000 | standby
-(2 rows)
-
$PSQL -c "show pool_nodes" test > result
# check the output of "show pool_nodes".
- cmp result ../expected.$mode > /dev/null 2>&1
+ LANG=C $PSQL -f ../create_expected.sql -v mode="'$mode'" -v dir="'$PGSOCKET_DIR'" test | tail -n 6 > expected
+ cmp result expected > /dev/null 2>&1
if [ $? != 0 ];then
./shutdownall
exit 1