Unix Technical Forum

BUG #1811: unique index problem

This is a discussion on BUG #1811: unique index problem within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1811 Logged by: George Jansen Email address: gjansen@aflcio.org PostgreSQL version: ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:04 AM
George Jansen
 
Posts: n/a
Default BUG #1811: unique index problem


The following bug has been logged online:

Bug reference: 1811
Logged by: George Jansen
Email address: gjansen@aflcio.org
PostgreSQL version: 8.0.3
Operating system: RedHat ES 4
Description: unique index problem
Details:

Importing a database in preparation for a Lyris cutover, I received an error
creating a unique index. In psql I checked the table:

lyris=# CREATE UNIQUE INDEX ix_uniquewords_word ON uniquewords_ USING btree
(word_);
ERROR: could not create unique index
DETAIL: Table contains duplicated values.
lyris=# SELECT word_, Count(*)
lyris-# FROM uniquewords_
lyris-# GROUP BY word_
lyris-# HAVING Count(*) > 1;
word_ | count
-------+-------
(0 rows)

lyris=#


Then I listed the words out in order to a text file
and ran


-bash-3.00$ uniq -c uwords | grep -v "^ *1"
2 avendano
2 espanol
-bash-3.00$

Both old and new databases use SQL_ASCII. Is this a bug?

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:04 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #1811: unique index problem

"George Jansen" <gjansen@aflcio.org> writes:
> [ inconsistent comparison behavior ]
> Both old and new databases use SQL_ASCII. Is this a bug?


I think it's probably a locale problem; did you initdb the database in C
locale? (Check SHOW LC_COLLATE and SHOW LC_CTYPE to be sure.) Usually
we see this sort of thing when the locale is expecting characters in a
different encoding than what's actually being stored.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

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 01:08 AM.


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