Unix Technical Forum

possible bug in case comparison on index scan.

This is a discussion on possible bug in case comparison on index scan. within the pgsql Hackers forums, part of the PostgreSQL category; --> I've uncovered a possible bug on that may be related to the other locale relation issues for win32 being ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 03:11 AM
Merlin Moncure
 
Posts: n/a
Default possible bug in case comparison on index scan.

I've uncovered a possible bug on that may be related to the other locale
relation issues for win32 being discussed right now. Basically, I have
a situation where a query is pulling up the wrong record based on string
case. So far, I have not been able to reproduce this in linux.

Here is the situation:
Database is initialized to the default locale which is "English_United
States.1252" (as reported by pg_controldata.exe). Databases initialized
to the 'C' locale don't have this problem. If this is just a locale
issue, I'm not concerned (just use the C locale), but just want to make
sure a btree related issue is not slipping through.

Observe:

esp=# select version();
version
------------------------------------------------------------------------
---------------------
PostgreSQL 8.0.0rc2 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
3.4.1 (mingw special)
(1 row)

esp=# prepare data9_start_nl_item_base_file_5 (character varying,
character varying, int4)
esp-# as select 1::int4, ib_sales_description_1 from
data9.item_base_file
esp-# where ib_sales_description_1 >= $1 and
esp-# (ib_sales_description_1 > $1 or ib_sales_description_2
>= $2)

esp-# order by ib_sales_description_1, ib_sales_description_2, id
esp-# limit $3;
PREPARE
esp=# execute data9_start_nl_item_base_file_5('SAT', '', 1 );
int4 | ib_sales_description_1
------+------------------------
1 | satellite
(1 row)

esp=# select 'sat' >= 'SAT';
?column?
----------
f
(1 row)

esp=# execute data9_start_nl_item_base_file_5('SAT', '', 2 );
int4 | ib_sales_description_1
------+-------------------------------
1 | satellite
1 | SATELLITE (current) AUTO DUAL
(2 rows)

Merlin

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:52 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com