Test_extensions installcheck fails with ICU provider, workaround

Поиск
Список
Период
Сортировка
От Aleksei Fakeev
Тема Test_extensions installcheck fails with ICU provider, workaround
Дата
Msg-id a2fd691f8d9f1325cec1283b161d6a8e@postgrespro.ru
обсуждение исходный текст
Ответы RE: Test_extensions installcheck fails with ICU provider, workaround
Список pgsql-hackers
@font-face { font-family: "Cambria Math"; } @font-face { font-family: Aptos; } #editbody1 p.v1MsoNormal, #editbody1 li.v1MsoNormal, #editbody1 div.v1MsoNormal { margin: 0cm; font-size: 11.0pt; font-family: "Aptos",sans-serif; mso-ligatures: standardcontextual; mso-fareast-language: EN-US; } #editbody1 span.v1EmailStyle17 { mso-style-type: personal-compose; font-family: "Aptos",sans-serif; color: windowtext; } #editbody1 .v1MsoChpDefault { mso-style-type: export-only; font-size: 11.0pt; mso-fareast-language: EN-US; } @page WordSection1 { size: 612.0pt 792.0pt; margin: 2.0cm 42.5pt 2.0cm 3.0cm; } #editbody1 div.v1WordSection1 { }

Hello there,

 

The test src/test/modules/test_extensions/sql/test_extensions.sql don't pass during make installcheck on the builds with ICU support (configure --with-icu) and with database created with this one's locale provider (initdb --locale-provider=icu --icu-locale=en-US).

 

A root cause is unstable sorting order of the output of the psql command \dx+, which is sorted according to the current locale rules, and then compared to expected etalon in the test, which was sorted with different provider rules.

Since the characters ')' and ',' have different orders when sorted by the ICU provider and ASCII sorted (--no-locale), the following output lines change their positions relative to each other:

"function varbitrange(bit varying,bit varying)"

"function varbitrange(bit varying,bit varying,text)"

 

I tried to use the \dx+ replacement function in this test with locale provider-independent sorting, and it solves the problem:

 

CREATE OR REPLACE FUNCTION dx_plus(schema_name char varying) RETURNS TABLE("Object description" char varying) AS

$$

BEGIN

                RETURN QUERY SELECT obj_descr::varchar AS "Object description" FROM (SELECT regexp_replace(pg_describe_object(classid, objid, objsubid)

                , 'pg_temp_\d+'

                , 'pg_temp', 'g') AS obj_descr

                FROM pg_depend

                WHERE refclassid = 'pg_extension'::regclass

                AND deptype = 'e'

                AND refobjid = (SELECT oid FROM pg_extension WHERE extname = schema_name))

                ORDER BY length(obj_descr), obj_descr;

END;

$$


__

PS:

Patches for a master branch are attached.

 

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Joel Jacobson"
Дата:
Сообщение: Re: Add pg_get_acl() function get the ACL for a database object
Следующее
От: Aleksander Alekseev
Дата:
Сообщение: Re: CREATE OR REPLACE MATERIALIZED VIEW