Making the regression tests locale-proof

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Making the regression tests locale-proof
Date: 2002-05-10 21:25:14
Message-ID: Pine.LNX.4.44.0205102300080.5390-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message cbbrowne 2002-05-10 21:40:03 Re: Monitoring backend activities
Previous Message mlw 2002-05-10 21:25:02 Native Win32, How about this?