Re: Unicode support - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Unicode support
Date
Msg-id 20090413192814.GH7709@alvh.no-ip.org
Whole thread Raw
In response to Unicode support  (- - <crossroads0000@googlemail.com>)
Responses Re: Unicode support  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: Unicode support  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
- - wrote:

> 1) Functions like char_length() or length() do NOT return the number
> of characters (the manual says they do), instead they return the
> number of code points.

I think you have client_encoding misconfigured.

alvherre=# select length('á'::text);length 
--------     1
(1 fila)

alvherre=# select pg_column_size('á');pg_column_size 
----------------             3
(1 fila)

(there's one byte of overhead here, so á is two bytes)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: proposal: add columns created and altered to pg_proc and pg_class
Next
From: Tom Lane
Date:
Subject: Re: Regression failure on RHEL 4 w/ PostgreSQL 8.4 beta1