@@ -126,7 +126,6 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
126126 requested_backup_id != INVALID_BACKUP_ID )
127127 elog (ERROR , "You cannot specify --archive and (-i, --backup-id) options together" );
128128
129- set_output_numeric_locale (LOCALE_C );
130129 /*
131130 * if instance is not specified,
132131 * show information about all instances in this backup catalog
@@ -149,7 +148,6 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
149148 show_instance (instanceState , INVALID_BACKUP_ID , true);
150149 }
151150 show_instance_end ();
152- set_output_numeric_locale (LOCALE_ENV );
153151
154152 return 0 ;
155153 }
@@ -168,7 +166,6 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
168166 show_instance (instanceState , requested_backup_id , false);
169167
170168 show_instance_end ();
171- set_output_numeric_locale (LOCALE_ENV );
172169
173170 return 0 ;
174171 }
@@ -182,7 +179,6 @@ do_show(CatalogState *catalogState, InstanceState *instanceState,
182179 else
183180 show_backup (instanceState , requested_backup_id );
184181
185- set_output_numeric_locale (LOCALE_ENV );
186182 return 0 ;
187183 }
188184}
@@ -555,6 +551,9 @@ show_instance_plain(const char *instance_name, parray *backup_list, bool show_na
555551 ShowBackendRow * rows ;
556552 TimeLineID parent_tli = 0 ;
557553
554+ // Since we've been printing a table, set LC_NUMERIC to its default environment value
555+ set_output_numeric_locale (LOCALE_ENV );
556+
558557 for (i = 0 ; i < SHOW_FIELDS_COUNT ; i ++ )
559558 widths [i ] = strlen (names [i ]);
560559
@@ -768,6 +767,8 @@ show_instance_plain(const char *instance_name, parray *backup_list, bool show_na
768767 }
769768
770769 pfree (rows );
770+ // Restore the C locale
771+ set_output_numeric_locale (LOCALE_C );
771772}
772773
773774/*
@@ -848,6 +849,9 @@ show_archive_plain(const char *instance_name, uint32 xlog_seg_size,
848849 uint32 widths_sum = 0 ;
849850 ShowArchiveRow * rows ;
850851
852+ // Since we've been printing a table, set LC_NUMERIC to its default environment value
853+ set_output_numeric_locale (LOCALE_ENV );
854+
851855 for (i = 0 ; i < SHOW_ARCHIVE_FIELDS_COUNT ; i ++ )
852856 widths [i ] = strlen (names [i ]);
853857
@@ -1015,6 +1019,8 @@ show_archive_plain(const char *instance_name, uint32 xlog_seg_size,
10151019 }
10161020
10171021 pfree (rows );
1022+ // Restore the C locale
1023+ set_output_numeric_locale (LOCALE_C );
10181024 //TODO: free timelines
10191025}
10201026
0 commit comments