@@ -22,7 +22,7 @@ def test_basic_full_catchup(self):
2222src_pg .safe_psql (
2323"postgres" ,
2424"CREATE TABLE ultimate_question AS SELECT 42 AS answer" )
25- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
25+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
2626
2727# do full catchup
2828dst_pg = self .make_empty_node (os .path .join (self .module_name ,self .fname ,'dst' ))
@@ -47,7 +47,7 @@ def test_basic_full_catchup(self):
4747dst_pg .slow_start ()
4848
4949# 2nd check: run verification query
50- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
50+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
5151self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
5252
5353# Cleanup
@@ -69,7 +69,7 @@ def test_full_catchup_with_tablespace(self):
6969src_pg .safe_psql (
7070"postgres" ,
7171"CREATE TABLE ultimate_question TABLESPACE tblspace1 AS SELECT 42 AS answer" )
72- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
72+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
7373
7474# do full catchup with tablespace mapping
7575dst_pg = self .make_empty_node (os .path .join (self .module_name ,self .fname ,'dst' ))
@@ -105,7 +105,7 @@ def test_full_catchup_with_tablespace(self):
105105dst_pg .slow_start ()
106106
107107# 2nd check: run verification query
108- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
108+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
109109self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
110110
111111# Cleanup
@@ -146,7 +146,7 @@ def test_basic_delta_catchup(self):
146146pgbench = src_pg .pgbench (options = ['-T' ,'10' ,'--no-vacuum' ])
147147pgbench .wait ()
148148src_pg .safe_psql ("postgres" ,"INSERT INTO ultimate_question VALUES(42)" )
149- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
149+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
150150
151151# do delta catchup
152152self .catchup_node (
@@ -171,7 +171,7 @@ def test_basic_delta_catchup(self):
171171dst_pg .slow_start (replica = True )
172172
173173# 2nd check: run verification query
174- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
174+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
175175self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
176176
177177# Cleanup
@@ -218,7 +218,7 @@ def test_basic_ptrack_catchup(self):
218218pgbench = src_pg .pgbench (options = ['-T' ,'10' ,'--no-vacuum' ])
219219pgbench .wait ()
220220src_pg .safe_psql ("postgres" ,"INSERT INTO ultimate_question VALUES(42)" )
221- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
221+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
222222
223223# do ptrack catchup
224224self .catchup_node (
@@ -243,7 +243,7 @@ def test_basic_ptrack_catchup(self):
243243dst_pg .slow_start (replica = True )
244244
245245# 2nd check: run verification query
246- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
246+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
247247self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
248248
249249# Cleanup
@@ -282,7 +282,7 @@ def test_tli_delta_catchup(self):
282282src_pg .slow_start (replica = True )
283283src_pg .promote ()
284284src_pg .safe_psql ("postgres" ,"CREATE TABLE ultimate_question AS SELECT 42 AS answer" )
285- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
285+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
286286
287287# do catchup (src_tli = 2, dst_tli = 1)
288288self .catchup_node (
@@ -306,7 +306,7 @@ def test_tli_delta_catchup(self):
306306dst_pg .slow_start (replica = True )
307307
308308# 2nd check: run verification query
309- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
309+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
310310self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
311311
312312dst_pg .stop ()
@@ -364,7 +364,7 @@ def test_tli_ptrack_catchup(self):
364364self .assertEqual (src_tli ,"2" ,"Postgres didn't update TLI after promote" )
365365
366366src_pg .safe_psql ("postgres" ,"CREATE TABLE ultimate_question AS SELECT 42 AS answer" )
367- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
367+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
368368
369369# do catchup (src_tli = 2, dst_tli = 1)
370370self .catchup_node (
@@ -388,7 +388,7 @@ def test_tli_ptrack_catchup(self):
388388dst_pg .slow_start (replica = True )
389389
390390# 2nd check: run verification query
391- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
391+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
392392self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
393393
394394dst_pg .stop ()
@@ -818,7 +818,7 @@ def test_tli_destination_mismatch(self):
818818
819819# preparation 3: "useful" changes
820820src_pg .safe_psql ("postgres" ,"CREATE TABLE ultimate_question AS SELECT 42 AS answer" )
821- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
821+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
822822
823823# try catchup
824824try :
@@ -832,7 +832,7 @@ def test_tli_destination_mismatch(self):
832832dst_options ['port' ]= str (dst_pg .port )
833833self .set_auto_conf (dst_pg ,dst_options )
834834dst_pg .slow_start ()
835- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
835+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
836836dst_pg .stop ()
837837self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
838838except ProbackupException as e :
@@ -896,7 +896,7 @@ def test_tli_source_mismatch(self):
896896
897897# preparation 4: "useful" changes
898898src_pg .safe_psql ("postgres" ,"CREATE TABLE ultimate_question AS SELECT 42 AS answer" )
899- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
899+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
900900
901901# try catchup
902902try :
@@ -910,7 +910,7 @@ def test_tli_source_mismatch(self):
910910dst_options ['port' ]= str (dst_pg .port )
911911self .set_auto_conf (dst_pg ,dst_options )
912912dst_pg .slow_start ()
913- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
913+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
914914dst_pg .stop ()
915915self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
916916except ProbackupException as e :
@@ -979,7 +979,7 @@ def test_unclean_delta_catchup(self):
979979pgbench = src_pg .pgbench (options = ['-T' ,'10' ,'--no-vacuum' ])
980980pgbench .wait ()
981981src_pg .safe_psql ("postgres" ,"INSERT INTO ultimate_question VALUES(42)" )
982- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
982+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
983983
984984# do delta catchup
985985self .catchup_node (
@@ -1004,7 +1004,7 @@ def test_unclean_delta_catchup(self):
10041004dst_pg .slow_start (replica = True )
10051005
10061006# 2nd check: run verification query
1007- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1007+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
10081008self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
10091009
10101010# Cleanup
@@ -1068,7 +1068,7 @@ def test_unclean_ptrack_catchup(self):
10681068pgbench = src_pg .pgbench (options = ['-T' ,'10' ,'--no-vacuum' ])
10691069pgbench .wait ()
10701070src_pg .safe_psql ("postgres" ,"INSERT INTO ultimate_question VALUES(42)" )
1071- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1071+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
10721072
10731073# do delta catchup
10741074self .catchup_node (
@@ -1093,7 +1093,7 @@ def test_unclean_ptrack_catchup(self):
10931093dst_pg .slow_start (replica = True )
10941094
10951095# 2nd check: run verification query
1096- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1096+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
10971097self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
10981098
10991099# Cleanup
@@ -1367,9 +1367,9 @@ def test_config_exclusion(self):
13671367
13681368# check: run verification query
13691369src_pg .safe_psql ("postgres" ,"INSERT INTO ultimate_question VALUES(42)" )
1370- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1370+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
13711371dst_pg .catchup ()# wait for replication
1372- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1372+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
13731373self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
13741374
13751375# preparation 4: make changes on master (source)
@@ -1397,9 +1397,9 @@ def test_config_exclusion(self):
13971397
13981398# check: run verification query
13991399src_pg .safe_psql ("postgres" ,"INSERT INTO ultimate_question VALUES(2*42)" )
1400- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1400+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
14011401dst_pg .catchup ()# wait for replication
1402- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1402+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
14031403self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
14041404
14051405# preparation 5: make changes on master (source)
@@ -1426,9 +1426,9 @@ def test_config_exclusion(self):
14261426
14271427# check: run verification query
14281428src_pg .safe_psql ("postgres" ,"INSERT INTO ultimate_question VALUES(3*42)" )
1429- src_query_result = src_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1429+ src_query_result = src_pg .table_checksum ( " ultimate_question" )
14301430dst_pg .catchup ()# wait for replication
1431- dst_query_result = dst_pg .safe_psql ( "postgres" , "SELECT * FROM ultimate_question" )
1431+ dst_query_result = dst_pg .table_checksum ( " ultimate_question" )
14321432self .assertEqual (src_query_result ,dst_query_result ,'Different answer from copy' )
14331433
14341434# Cleanup