While commit
5b275a6e1 fixed a few unhappy buildfarm animals,
it looks like the remainder simply don't have any es_ES locale
at all. There's little point in running the test in that case,
so minimize the number of variant expected-files by bailing out.
Also emit a log entry so that it's possible to tell from buildfarm
postmaster logs which case occurred.
Possibly, the scope of this testing could be improved by providing
additional translations. But I think it's likely that the failing
animals have no non-C locales installed at all.
In passing, update typedefs.list so that koel doesn't think
regress.c is misformatted.
Discussion: https://postgr.es/m/
[email protected]
-- There's less standardization in locale name spellings than one could wish.
-- While some platforms insist on having a codeset name in lc_messages,
-- fortunately it seems that it need not match the actual database encoding.
+-- However, if no es_ES locale is installed at all, this'll fail.
+SET lc_messages = 'C';
do $$
declare locale text; ok bool;
begin
end;
exit when ok;
end loop;
+ -- Don't clutter the expected results with this info, just log it
+ raise log 'NLS regression test: lc_messages = %',
+ current_setting('lc_messages');
end $$;
+SELECT current_setting('lc_messages') = 'C' AS failed \gset
+\if :failed
+\echo Could not find an acceptable spelling of es_ES locale
+\quit
+\endif
SELECT test_translation();
NOTICE: traducido PRId64 = 424242424242
NOTICE: traducido PRId32 = -1234
-- There's less standardization in locale name spellings than one could wish.
-- While some platforms insist on having a codeset name in lc_messages,
-- fortunately it seems that it need not match the actual database encoding.
+-- However, if no es_ES locale is installed at all, this'll fail.
+SET lc_messages = 'C';
do $$
declare locale text; ok bool;
begin
end;
exit when ok;
end loop;
+ -- Don't clutter the expected results with this info, just log it
+ raise log 'NLS regression test: lc_messages = %',
+ current_setting('lc_messages');
end $$;
+SELECT current_setting('lc_messages') = 'C' AS failed \gset
+\if :failed
+\echo Could not find an acceptable spelling of es_ES locale
+\quit
+\endif
SELECT test_translation();
NOTICE: NLS is not enabled
test_translation
--- /dev/null
+-- directory paths and dlsuffix are passed to us in environment variables
+\getenv libdir PG_LIBDIR
+\getenv dlsuffix PG_DLSUFFIX
+\set regresslib :libdir '/regress' :dlsuffix
+CREATE FUNCTION test_translation()
+ RETURNS void
+ AS :'regresslib'
+ LANGUAGE C;
+-- There's less standardization in locale name spellings than one could wish.
+-- While some platforms insist on having a codeset name in lc_messages,
+-- fortunately it seems that it need not match the actual database encoding.
+-- However, if no es_ES locale is installed at all, this'll fail.
+SET lc_messages = 'C';
+do $$
+declare locale text; ok bool;
+begin
+ for locale in values('es_ES'), ('es_ES.UTF-8'), ('es_ES.utf8')
+ loop
+ ok = true;
+ begin
+ execute format('set lc_messages = %L', locale);
+ exception when invalid_parameter_value then
+ ok = false;
+ end;
+ exit when ok;
+ end loop;
+ -- Don't clutter the expected results with this info, just log it
+ raise log 'NLS regression test: lc_messages = %',
+ current_setting('lc_messages');
+end $$;
+SELECT current_setting('lc_messages') = 'C' AS failed \gset
+\if :failed
+\echo Could not find an acceptable spelling of es_ES locale
+Could not find an acceptable spelling of es_ES locale
+\quit
-- There's less standardization in locale name spellings than one could wish.
-- While some platforms insist on having a codeset name in lc_messages,
-- fortunately it seems that it need not match the actual database encoding.
+-- However, if no es_ES locale is installed at all, this'll fail.
+SET lc_messages = 'C';
+
do $$
declare locale text; ok bool;
begin
end;
exit when ok;
end loop;
+ -- Don't clutter the expected results with this info, just log it
+ raise log 'NLS regression test: lc_messages = %',
+ current_setting('lc_messages');
end $$;
+SELECT current_setting('lc_messages') = 'C' AS failed \gset
+\if :failed
+\echo Could not find an acceptable spelling of es_ES locale
+\quit
+\endif
+
SELECT test_translation();
RESET lc_messages;
int_fast32_t
int_fast64_t
internalPQconninfoOption
+intmax_t
intptr_t
intset_internal_node
intset_leaf_node
uint8_t
uint8x16_t
uint_fast64_t
+uintmax_t
uintptr_t
unicodeStyleBorderFormat
unicodeStyleColumnFormat