Re: Strange UTF-8 behaviour

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Marco Ferretti <marco(dot)ferretti(at)jrc(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange UTF-8 behaviour
Date: 2004-09-16 16:37:10
Message-ID: 20040916163710.GA17027@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 16, 2004 at 06:10:13PM +0200, Marco Ferretti wrote:

> I am quite new to Postgres, so forgive me if this question seems
> obvious. <br>
> <br>
> I have created a database with the UTF-8 encoding&nbsp; (createdb cassa
> --encoding=UTF-8) .<br>
> Then I have made the following tests :<br>

FWIW, I can't reproduce this using 7.3.6. Is there anything special
about your 'e' character, or it's a plain 'e'?

$ createdb test --encoding=UTF-8
CREATE DATABASE
COMMENT

$ psql test
Welcome to psql 7.3.6, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

test=# create table test (id char(5));
CREATE TABLE
test=# insert into test values ('1234e');
INSERT 16993 1
test=# create table test2 (id varchar(5));
CREATE TABLE
test=# insert into test2 values ('1234e');
INSERT 16996 1
test=# insert into test2 values ('123e');
INSERT 16997 1
test=# select '#' || id || '#', length(id) from test2;
?column? | length
----------+--------
#1234e# | 5
#123e# | 4
(2 rows)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Escucha y olvidarás; ve y recordarás; haz y entenderás" (Confucio)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-09-16 18:12:40 Re: [HACKERS] Problems with SPI memory management
Previous Message Jeff 2004-09-16 16:35:50 Re: Postgres memory usage