Making the regression tests locale-proof - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Making the regression tests locale-proof
Date
Msg-id Pine.LNX.4.44.0205102300080.5390-100000@localhost.localdomain
Whole thread Raw
Responses Re: Making the regression tests locale-proof  (teg@redhat.com (Trond Eivind Glomsrød))
Re: Making the regression tests locale-proof  (Hannu Krosing <hannu@tm.ee>)
Re: Making the regression tests locale-proof  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Since locale support is now enabled by default, it is desirable that the
regression tests can pass if the clusters locale is not C.

As a first step I have included the following statements in pg_regress
right after the database is created:

alter database "$dbname" set lc_messages to 'C';
alter database "$dbname" set lc_monetary to 'C';
alter database "$dbname" set lc_numeric to 'C';
alter database "$dbname" set lc_time to 'C';

This gets rid of a boatload of failures related to number formatting.
For that purpose I have changed the permissions on these options to
USERSET.  (I'm still debating making lc_messages SUSET, because otherwise
users can screw with admins by changing the language of the log output all
the time.  Comments?)

The remaining issue is the sort order.  I think this can be solved for
practical purposes by creating two expected files for each affected test,
say char.out and char-locale.out.  The regression test driver would try
the first one, if that fails try the second one.

The assumption here is that all locales will choose the same sort order as
long as they're dealing only with the core 26 letters.  This does not have
to be true in theory, but I think it works for the vast majority of
practical cases.

We could also cut down the number of affected tests by making the
select_implicit and select_having not use mixed-case strings in the test
tables.  Then we have only char, varchar, and select_views left.

Comments?

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: "Daniel H. F. e Silva"
Date:
Subject: Monitoring backend activities
Next
From: mlw
Date:
Subject: Native Win32, How about this?