Re: how is text-equality handled in postgresql? - Mailing list pgsql-general

From Ivan Voras
Subject Re: how is text-equality handled in postgresql?
Date
Msg-id lb5oh2$77f$1@ger.gmane.org
Whole thread Raw
In response to how is text-equality handled in postgresql?  (Gábor Farkas <gabor.farkas@gmail.com>)
Responses Re: how is text-equality handled in postgresql?  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-general
On 15/01/2014 10:10, Gábor Farkas wrote:
> hi,
>
> when i create an unique-constraint on a varchar field, how exactly
> does postgresql compare the texts? i'm asking because in UNICODE there
> are a lot of complexities about this..
>
> or in other words, when are two varchars equal in postgres? when their
> bytes are? or some algorithm is applied?

By default, it is "whatever the operating system thinks it's right".
PostgreSQL doesn't have its own collation code, it uses the OS's locale
support for this.

(which breaks on certain systems which don't have complete UTF-8 support
- I'm in favour of importing ICU at least as an optional dependancy,
similar to what the FreeBSD's patch does:
http://people.freebsd.org/~girgen/postgresql-icu/).


Attachment

pgsql-general by date:

Previous
From: Gábor Farkas
Date:
Subject: how is text-equality handled in postgresql?
Next
From: Sameer Kumar
Date:
Subject: Re: pg_basebackup failing