Re: varchar as primary key

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Alexander Staubo <alex(at)purefiction(dot)net>, Matthew Hixson <hixson(at)poindextrose(dot)org>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: varchar as primary key
Date: 2007-05-04 03:08:29
Message-ID: 9642.1178248109@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Davis <pgsql(at)j-davis(dot)com> writes:
> If you're using a non-C locale, it's slower than strcmp() too.
> PostgreSQL has to do an extra memcpy() in order to use strcoll(),
> because strings in postgresql aren't necessarily NULL-terminated and
> there's no such thing as strncoll(), unfortunately (a comment in the
> code points this out).

The memcpy is the least of the problem --- in many non-C locales,
strcoll() is simply a dog, because the collation rules are ridiculously
complex.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-05-04 03:49:25 Re: How to get comments for view columns?
Previous Message Mike Frysinger 2007-05-04 02:39:47 Re: cant get pg_dump/pg_restore to behave