public inbox for [email protected]  
help / color / mirror / Atom feed
From: Oleg Tselebrovskiy <[email protected]>
To: [email protected]
Subject: [PROPOSAL] Skip test citext_utf8 on Windows
Date: Mon, 11 Mar 2024 15:21:11 +0700
Message-ID: <[email protected]> (raw)

Greetings, everyone!

While running "installchecks" on databases with UTF-8 encoding the test
citext_utf8 fails because of Turkish dotted I like this:

  SELECT 'i'::citext = 'İ'::citext AS t;
   t
  ---
- t
+ f
  (1 row)

I tried to replicate the test's results by hand and with any collation
that I tried (including --locale="Turkish") this test failed

Also an interesing result of my tesing. If you initialize you DB
with -E utf-8 --locale="Turkish" and then run select LOWER('İ');
the output will be this:
  lower
-------
  İ
(1 row)

Which I find strange since lower() uses collation that was passed
(default in this case but still)

My PostgreSQL version is this:
postgres=# select version();
                                version
----------------------------------------------------------------------
  PostgreSQL 17devel on x86_64-windows, compiled by gcc-13.1.0, 64-bit

The proposed patch for skipping test is attached

Oleg Tselebrovskiy, Postgres Pro

Attachments:

  [text/x-diff] skip_citext_utf8.patch (3.7K, ../[email protected]/2-skip_citext_utf8.patch)
  download | inline diff:
��diff --git a/contrib/citext/expected/citext_utf8.out b/contrib/citext/expected/citext_utf8.out

index 5d988dcd485..6c4069f9469 100644

--- a/contrib/citext/expected/citext_utf8.out

+++ b/contrib/citext/expected/citext_utf8.out

@@ -10,7 +10,8 @@

 SELECT getdatabaseencoding() <> 'UTF8' OR

        (SELECT (datlocprovider = 'c' AND datctype = 'C') OR datlocprovider = 'i'

         FROM pg_database

-        WHERE datname=current_database())

+        WHERE datname=current_database()) OR

+	   (version() ~ 'windows' OR version() ~ 'Visual C\+\+' OR version() ~ 'mingw32')

        AS skip_test \gset

 \if :skip_test

 \quit

diff --git a/contrib/citext/expected/citext_utf8_1.out b/contrib/citext/expected/citext_utf8_1.out

index 7065a5da190..d4472b1c36a 100644

--- a/contrib/citext/expected/citext_utf8_1.out

+++ b/contrib/citext/expected/citext_utf8_1.out

@@ -10,7 +10,8 @@

 SELECT getdatabaseencoding() <> 'UTF8' OR

        (SELECT (datlocprovider = 'c' AND datctype = 'C') OR datlocprovider = 'i'

         FROM pg_database

-        WHERE datname=current_database())

+        WHERE datname=current_database()) OR

+	   (version() ~ 'windows' OR version() ~ 'Visual C\+\+' OR version() ~ 'mingw32')

        AS skip_test \gset

 \if :skip_test

 \quit

diff --git a/contrib/citext/sql/citext_utf8.sql b/contrib/citext/sql/citext_utf8.sql

index 34b232d64e2..53775cdcd35 100644

--- a/contrib/citext/sql/citext_utf8.sql

+++ b/contrib/citext/sql/citext_utf8.sql

@@ -11,7 +11,8 @@

 SELECT getdatabaseencoding() <> 'UTF8' OR

        (SELECT (datlocprovider = 'c' AND datctype = 'C') OR datlocprovider = 'i'

         FROM pg_database

-        WHERE datname=current_database())

+        WHERE datname=current_database()) OR

+	   (version() ~ 'windows' OR version() ~ 'Visual C\+\+' OR version() ~ 'mingw32')

        AS skip_test \gset

 \if :skip_test

 \quit



view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [PROPOSAL] Skip test citext_utf8 on Windows
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox