pg_dump: Fix new ICU tests
authorPeter Eisentraut <[email protected]>
Thu, 25 Aug 2022 04:35:16 +0000 (06:35 +0200)
committerPeter Eisentraut <[email protected]>
Thu, 25 Aug 2022 04:35:16 +0000 (06:35 +0200)
ICU doesn't support some server encodings, so we need to exclude them
if a non-supported encoding was set up.

src/bin/pg_dump/t/002_pg_dump.pl

index 383bb46b25e5f32d4d8a7cf7d531e2f8f35c8c8a..2873b662fb655717f3f4bf97fb5e4e68e4bf36c3 100644 (file)
@@ -3903,6 +3903,10 @@ my $supports_icu  = ($ENV{with_icu} eq 'yes');
 my $supports_lz4  = check_pg_config("#define USE_LZ4 1");
 my $supports_gzip = check_pg_config("#define HAVE_LIBZ 1");
 
+# ICU doesn't work with some encodings
+my $encoding = $node->safe_psql('postgres', 'show server_encoding');
+$supports_icu = 0 if $encoding eq 'SQL_ASCII';
+
 # Create additional databases for mutations of schema public
 $node->psql('postgres', 'create database regress_pg_dump_test;');
 $node->psql('postgres', 'create database regress_public_owner;');