@@ -126,7 +126,6 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
126
126
requested_backup_id != INVALID_BACKUP_ID )
127
127
elog (ERROR , "You cannot specify --archive and (-i, --backup-id) options together" );
128
128
129
- set_output_numeric_locale (LOCALE_C );
130
129
/*
131
130
* if instance is not specified,
132
131
* show information about all instances in this backup catalog
@@ -149,7 +148,6 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
149
148
show_instance (instanceState , INVALID_BACKUP_ID , true);
150
149
}
151
150
show_instance_end ();
152
- set_output_numeric_locale (LOCALE_ENV );
153
151
154
152
return 0 ;
155
153
}
@@ -168,7 +166,6 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
168
166
show_instance (instanceState , requested_backup_id , false);
169
167
170
168
show_instance_end ();
171
- set_output_numeric_locale (LOCALE_ENV );
172
169
173
170
return 0 ;
174
171
}
@@ -182,7 +179,6 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
182
179
else
183
180
show_backup (instanceState , requested_backup_id );
184
181
185
- set_output_numeric_locale (LOCALE_ENV );
186
182
return 0 ;
187
183
}
188
184
}
@@ -555,6 +551,9 @@ show_instance_plain(const char *instance_name, parray *backup_list, bool show_na
555
551
ShowBackendRow * rows ;
556
552
TimeLineID parent_tli = 0 ;
557
553
554
+ // Since we've been printing a table, set LC_NUMERIC to its default environment value
555
+ set_output_numeric_locale (LOCALE_ENV );
556
+
558
557
for (i = 0 ; i < SHOW_FIELDS_COUNT ; i ++ )
559
558
widths [i ] = strlen (names [i ]);
560
559
@@ -768,6 +767,8 @@ show_instance_plain(const char *instance_name, parray *backup_list, bool show_na
768
767
}
769
768
770
769
pfree (rows );
770
+ // Restore the C locale
771
+ set_output_numeric_locale (LOCALE_C );
771
772
}
772
773
773
774
/*
@@ -848,6 +849,9 @@ show_archive_plain(const char *instance_name, uint32 xlog_seg_size,
848
849
uint32 widths_sum = 0 ;
849
850
ShowArchiveRow * rows ;
850
851
852
+ // Since we've been printing a table, set LC_NUMERIC to its default environment value
853
+ set_output_numeric_locale (LOCALE_ENV );
854
+
851
855
for (i = 0 ; i < SHOW_ARCHIVE_FIELDS_COUNT ; i ++ )
852
856
widths [i ] = strlen (names [i ]);
853
857
@@ -1015,6 +1019,8 @@ show_archive_plain(const char *instance_name, uint32 xlog_seg_size,
1015
1019
}
1016
1020
1017
1021
pfree (rows );
1022
+ // Restore the C locale
1023
+ set_output_numeric_locale (LOCALE_C );
1018
1024
//TODO: free timelines
1019
1025
}
1020
1026
0 commit comments