diff --git a/contrib/unaccent/Makefile b/contrib/unaccent/Makefile index d6c466e07ad..652a3e774c0 100644 --- a/contrib/unaccent/Makefile +++ b/contrib/unaccent/Makefile @@ -12,10 +12,6 @@ PGFILEDESC = "unaccent - text search dictionary that removes accents" REGRESS = unaccent -# We need a UTF8 database -ENCODING = UTF8 -NO_LOCALE = 1 - ifdef USE_PGXS PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/contrib/unaccent/expected/unaccent.out b/contrib/unaccent/expected/unaccent.out index ee0ac71a1cc..f080707c4ac 100644 --- a/contrib/unaccent/expected/unaccent.out +++ b/contrib/unaccent/expected/unaccent.out @@ -1,11 +1,13 @@ +/* + * This test must be run in a database with UTF-8 encoding, + * because other encodings don't support all the characters used. + */ +SELECT getdatabaseencoding() <> 'UTF8' + AS skip_test \gset +\if :skip_test +\quit +\endif CREATE EXTENSION unaccent; --- must have a UTF8 database -SELECT getdatabaseencoding(); - getdatabaseencoding ---------------------- - UTF8 -(1 row) - SET client_encoding TO 'UTF8'; SELECT unaccent('foobar'); unaccent diff --git a/contrib/unaccent/expected/unaccent_1.out b/contrib/unaccent/expected/unaccent_1.out new file mode 100644 index 00000000000..37aead89c0c --- /dev/null +++ b/contrib/unaccent/expected/unaccent_1.out @@ -0,0 +1,8 @@ +/* + * This test must be run in a database with UTF-8 encoding, + * because other encodings don't support all the characters used. + */ +SELECT getdatabaseencoding() <> 'UTF8' + AS skip_test \gset +\if :skip_test +\quit diff --git a/contrib/unaccent/meson.build b/contrib/unaccent/meson.build index bd629ec090e..a93bf10468d 100644 --- a/contrib/unaccent/meson.build +++ b/contrib/unaccent/meson.build @@ -37,6 +37,5 @@ tests += { 'sql': [ 'unaccent', ], - 'regress_args': ['--no-locale', '--encoding=UTF8'], }, } diff --git a/contrib/unaccent/sql/unaccent.sql b/contrib/unaccent/sql/unaccent.sql index 3fc0c706be3..663646c1ac4 100644 --- a/contrib/unaccent/sql/unaccent.sql +++ b/contrib/unaccent/sql/unaccent.sql @@ -1,7 +1,15 @@ -CREATE EXTENSION unaccent; +/* + * This test must be run in a database with UTF-8 encoding, + * because other encodings don't support all the characters used. + */ --- must have a UTF8 database -SELECT getdatabaseencoding(); +SELECT getdatabaseencoding() <> 'UTF8' + AS skip_test \gset +\if :skip_test +\quit +\endif + +CREATE EXTENSION unaccent; SET client_encoding TO 'UTF8';