=?iso-8859-1?B?ZGrpIGRq6Q==?= <[EMAIL PROTECTED]> writes:
> I get the error : ERROR: duplicate key violates unique constraint 
> "unique_barcode128"
> But the string returned by text2code128('AB28662097') and 
> text2code128('AB28662098') are different!!!, i.e., respectively ÌABÇ<b4ÅÃÎ 
> and ÌABÇ<b4ÆÊÎ.

What locale are you running the server in?  It's possible that these
strings are equal according to the locale-specific strcoll() behavior.
In particular, if you are using a locale that expects UTF8, it's pretty
common for strcoll to go nuts when faced with non-UTF8-legal strings.

You might be better off using bytea instead of varchar.

                        regards, tom lane

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

Reply via email to