Re: Regular expressions w localization problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Regular expressions w localization problem
Date: 2005-11-25 19:21:01
Message-ID: 24837.1132946461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx> writes:
> I'm facing a problem I have seen before but never got the time to
> report until now that is biting me again. I have a table which has
> some CHECK constrains using regular expressions and one check is
> failing when I try to insert some valid data. The constraint
> definition is:

> nombre propio vlido CHECK (nombre ~ '^[[:upper:]][[:lower:]]*([-\'. [:alpha:]]+)?$'::text)

> And the data is ``Jos Luis''.

I believe the meanings of [[:upper:]] and friends depend on the database
locale, and the current code for them probably doesn't work at all in
multibyte database encodings either. So, what locale and encoding
are you using?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Taber 2005-11-25 19:57:59 Re: pg_connect troubles on localhost
Previous Message Manuel Sugawara 2005-11-25 19:19:41 Re: Regular expressions w localization problem