File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -656,9 +656,25 @@ main(int argc, char **argv)
656
656
* When running against 9.0 or later, check if we are in recovery mode,
657
657
* which means we are on a hot standby.
658
658
*/
659
- if (fout -> remoteVersion >= 90000 )
659
+ if (g_fout -> remoteVersion >= 90000 )
660
660
{
661
- PGresult * res = ExecuteSqlQueryForSingleRow (fout , "SELECT pg_catalog.pg_is_in_recovery()" );
661
+ PGresult * res ;
662
+ const char * query = "SELECT pg_catalog.pg_is_in_recovery()" ;
663
+ int ntups ;
664
+
665
+ res = PQexec (g_conn , query );
666
+ check_sql_result (res , g_conn , query , PGRES_TUPLES_OK );
667
+ ntups = PQntuples (res );
668
+
669
+ if (ntups != 1 )
670
+ {
671
+ write_msg (NULL , ngettext ("query returned %d row instead of one: %s\n" ,
672
+ "query returned %d rows instead of one: %s\n" ,
673
+ ntups ),
674
+ ntups , query );
675
+ exit_nicely ();
676
+ }
677
+
662
678
if (strcmp (PQgetvalue (res , 0 , 0 ), "t" ) == 0 )
663
679
{
664
680
/*
You can’t perform that action at this time.
0 commit comments