Svenne Krap <svenne.li...@krap.dk> wrote:
> On 18-06-2013 22:18, Jeff Janes wrote:

>>   In Danish, apparently 'AA' > 'WA', so two more rows show up.
>
> Yes of course....
>
> We have three extra vowels following Z (namely Æ, Ø and Å) and
> for keyboard missing those essential keys we have an official
> alternate way to write them as AE , OE and AA.
>
> Which of course means that AA is larger than any other letter ;)

Does anyone object to the attached change, so that regression tests
pass when run in a Danish locale?  I think it should be
back-patched to 9.2, where the test was introduced.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
*** a/src/test/regress/expected/create_index.out
--- b/src/test/regress/expected/create_index.out
***************
*** 2652,2657 **** SELECT count(*) FROM tenk1
--- 2652,2659 ----
  
  --
  -- Check behavior with duplicate index column contents
+ -- The upper limit on f1 is to protect against problems in Danish collations
+ -- due to 'AA' sorting above 'Z'.
  --
  CREATE TABLE dupindexcols AS
    SELECT unique1 as id, stringu2::text as f1 FROM tenk1;
***************
*** 2659,2676 **** CREATE INDEX dupindexcols_i ON dupindexcols (f1, id, f1 text_pattern_ops);
  ANALYZE dupindexcols;
  EXPLAIN (COSTS OFF)
    SELECT count(*) FROM dupindexcols
!     WHERE f1 > 'WA' and id < 1000 and f1 ~<~ 'YX';
!                                       QUERY PLAN                                       
! ---------------------------------------------------------------------------------------
   Aggregate
     ->  Bitmap Heap Scan on dupindexcols
!          Recheck Cond: ((f1 > 'WA'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
           ->  Bitmap Index Scan on dupindexcols_i
!                Index Cond: ((f1 > 'WA'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
  (5 rows)
  
  SELECT count(*) FROM dupindexcols
!   WHERE f1 > 'WA' and id < 1000 and f1 ~<~ 'YX';
   count 
  -------
      97
--- 2661,2678 ----
  ANALYZE dupindexcols;
  EXPLAIN (COSTS OFF)
    SELECT count(*) FROM dupindexcols
!     WHERE f1 BETWEEN 'WA' AND 'ZZZ' and id < 1000 and f1 ~<~ 'YX';
!                                                    QUERY PLAN                                                   
! ----------------------------------------------------------------------------------------------------------------
   Aggregate
     ->  Bitmap Heap Scan on dupindexcols
!          Recheck Cond: ((f1 >= 'WA'::text) AND (f1 <= 'ZZZ'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
           ->  Bitmap Index Scan on dupindexcols_i
!                Index Cond: ((f1 >= 'WA'::text) AND (f1 <= 'ZZZ'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
  (5 rows)
  
  SELECT count(*) FROM dupindexcols
!   WHERE f1 BETWEEN 'WA' AND 'ZZZ' and id < 1000 and f1 ~<~ 'YX';
   count 
  -------
      97
*** a/src/test/regress/sql/create_index.sql
--- b/src/test/regress/sql/create_index.sql
***************
*** 876,881 **** SELECT count(*) FROM tenk1
--- 876,883 ----
  
  --
  -- Check behavior with duplicate index column contents
+ -- The upper limit on f1 is to protect against problems in Danish collations
+ -- due to 'AA' sorting above 'Z'.
  --
  
  CREATE TABLE dupindexcols AS
***************
*** 885,893 **** ANALYZE dupindexcols;
  
  EXPLAIN (COSTS OFF)
    SELECT count(*) FROM dupindexcols
!     WHERE f1 > 'WA' and id < 1000 and f1 ~<~ 'YX';
  SELECT count(*) FROM dupindexcols
!   WHERE f1 > 'WA' and id < 1000 and f1 ~<~ 'YX';
  
  --
  -- Check ordering of =ANY indexqual results (bug in 9.2.0)
--- 887,895 ----
  
  EXPLAIN (COSTS OFF)
    SELECT count(*) FROM dupindexcols
!     WHERE f1 BETWEEN 'WA' AND 'ZZZ' and id < 1000 and f1 ~<~ 'YX';
  SELECT count(*) FROM dupindexcols
!   WHERE f1 BETWEEN 'WA' AND 'ZZZ' and id < 1000 and f1 ~<~ 'YX';
  
  --
  -- Check ordering of =ANY indexqual results (bug in 9.2.0)
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to