@@ -711,7 +711,6 @@ check_proper_datallowconn(ClusterInfo *cluster)
711
711
int i_datallowconn ;
712
712
FILE * script = NULL ;
713
713
char output_path [MAXPGPATH ];
714
- bool found = false;
715
714
716
715
prep_status ("Checking database connection settings" );
717
716
@@ -750,7 +749,6 @@ check_proper_datallowconn(ClusterInfo *cluster)
750
749
*/
751
750
if (strcmp (datallowconn , "f" ) == 0 )
752
751
{
753
- found = true;
754
752
if (script == NULL && (script = fopen_priv (output_path , "w" )) == NULL )
755
753
pg_fatal ("could not open file \"%s\": %s" ,
756
754
output_path , strerror (errno ));
@@ -765,10 +763,8 @@ check_proper_datallowconn(ClusterInfo *cluster)
765
763
PQfinish (conn_template1 );
766
764
767
765
if (script )
768
- fclose (script );
769
-
770
- if (found )
771
766
{
767
+ fclose (script );
772
768
pg_log (PG_REPORT , "fatal" );
773
769
pg_fatal ("All non-template0 databases must allow connections, i.e. their\n"
774
770
"pg_database.datallowconn must be true. Your installation contains\n"
@@ -829,7 +825,6 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo *cluster)
829
825
{
830
826
int dbnum ;
831
827
FILE * script = NULL ;
832
- bool found = false;
833
828
char output_path [MAXPGPATH ];
834
829
835
830
prep_status ("Checking for contrib/isn with bigint-passing mismatch" );
@@ -870,7 +865,6 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo *cluster)
870
865
i_proname = PQfnumber (res , "proname" );
871
866
for (rowno = 0 ; rowno < ntups ; rowno ++ )
872
867
{
873
- found = true;
874
868
if (script == NULL && (script = fopen_priv (output_path , "w" )) == NULL )
875
869
pg_fatal ("could not open file \"%s\": %s" ,
876
870
output_path , strerror (errno ));
@@ -890,10 +884,8 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo *cluster)
890
884
}
891
885
892
886
if (script )
893
- fclose (script );
894
-
895
- if (found )
896
887
{
888
+ fclose (script );
897
889
pg_log (PG_REPORT , "fatal" );
898
890
pg_fatal ("Your installation contains \"contrib/isn\" functions which rely on the\n"
899
891
"bigint data type. Your old and new clusters pass bigint values\n"
@@ -915,7 +907,6 @@ check_for_user_defined_postfix_ops(ClusterInfo *cluster)
915
907
{
916
908
int dbnum ;
917
909
FILE * script = NULL ;
918
- bool found = false;
919
910
char output_path [MAXPGPATH ];
920
911
921
912
prep_status ("Checking for user-defined postfix operators" );
@@ -968,7 +959,6 @@ check_for_user_defined_postfix_ops(ClusterInfo *cluster)
968
959
i_typname = PQfnumber (res , "typname" );
969
960
for (rowno = 0 ; rowno < ntups ; rowno ++ )
970
961
{
971
- found = true;
972
962
if (script == NULL &&
973
963
(script = fopen_priv (output_path , "w" )) == NULL )
974
964
pg_fatal ("could not open file \"%s\": %s" ,
@@ -992,10 +982,8 @@ check_for_user_defined_postfix_ops(ClusterInfo *cluster)
992
982
}
993
983
994
984
if (script )
995
- fclose (script );
996
-
997
- if (found )
998
985
{
986
+ fclose (script );
999
987
pg_log (PG_REPORT , "fatal" );
1000
988
pg_fatal ("Your installation contains user-defined postfix operators, which are not\n"
1001
989
"supported anymore. Consider dropping the postfix operators and replacing\n"
@@ -1145,7 +1133,6 @@ check_for_tables_with_oids(ClusterInfo *cluster)
1145
1133
{
1146
1134
int dbnum ;
1147
1135
FILE * script = NULL ;
1148
- bool found = false;
1149
1136
char output_path [MAXPGPATH ];
1150
1137
1151
1138
prep_status ("Checking for tables WITH OIDS" );
@@ -1179,7 +1166,6 @@ check_for_tables_with_oids(ClusterInfo *cluster)
1179
1166
i_relname = PQfnumber (res , "relname" );
1180
1167
for (rowno = 0 ; rowno < ntups ; rowno ++ )
1181
1168
{
1182
- found = true;
1183
1169
if (script == NULL && (script = fopen_priv (output_path , "w" )) == NULL )
1184
1170
pg_fatal ("could not open file \"%s\": %s" ,
1185
1171
output_path , strerror (errno ));
@@ -1199,10 +1185,8 @@ check_for_tables_with_oids(ClusterInfo *cluster)
1199
1185
}
1200
1186
1201
1187
if (script )
1202
- fclose (script );
1203
-
1204
- if (found )
1205
1188
{
1189
+ fclose (script );
1206
1190
pg_log (PG_REPORT , "fatal" );
1207
1191
pg_fatal ("Your installation contains tables declared WITH OIDS, which is not\n"
1208
1192
"supported anymore. Consider removing the oid column using\n"
@@ -1401,7 +1385,6 @@ check_for_user_defined_encoding_conversions(ClusterInfo *cluster)
1401
1385
{
1402
1386
int dbnum ;
1403
1387
FILE * script = NULL ;
1404
- bool found = false;
1405
1388
char output_path [MAXPGPATH ];
1406
1389
1407
1390
prep_status ("Checking for user-defined encoding conversions" );
@@ -1441,7 +1424,6 @@ check_for_user_defined_encoding_conversions(ClusterInfo *cluster)
1441
1424
i_nspname = PQfnumber (res , "nspname" );
1442
1425
for (rowno = 0 ; rowno < ntups ; rowno ++ )
1443
1426
{
1444
- found = true;
1445
1427
if (script == NULL &&
1446
1428
(script = fopen_priv (output_path , "w" )) == NULL )
1447
1429
pg_fatal ("could not open file \"%s\": %s" ,
@@ -1463,10 +1445,8 @@ check_for_user_defined_encoding_conversions(ClusterInfo *cluster)
1463
1445
}
1464
1446
1465
1447
if (script )
1466
- fclose (script );
1467
-
1468
- if (found )
1469
1448
{
1449
+ fclose (script );
1470
1450
pg_log (PG_REPORT , "fatal" );
1471
1451
pg_fatal ("Your installation contains user-defined encoding conversions.\n"
1472
1452
"The conversion function parameters changed in PostgreSQL version 14\n"
0 commit comments