length() return wrong result - Mailing list pgsql-bugs

From Cédric Villemain
Subject length() return wrong result
Date
Msg-id 49D9C544.7030108@dalibo.com
Whole thread Raw
Responses Re: length() return wrong result  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-bugs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

- From the documentation, length(string) is 'Number of characters in string'

But it didn't :

1/ in a LATIN9 database:

postgres=# show server_encoding;server_encoding
- -----------------LATIN9

postgres=# set client_encoding = utf8;
SET
postgres=# select length('é');length
- --------     1

postgres=# set client_encoding = latin9;
SET
postgres=# select length('é');length
- --------     2

2/ in a UTF8 database:

postgres=# show server_encoding;server_encoding
- -----------------UTF8

postgres=# set client_encoding = utf8;
SET
postgres=# select length('é');length
- --------     1

postgres=# set client_encoding = latin9;
SET
postgres=# select length('é');length
- --------     2





- --
Cédric Villemain
Administrateur de Base de Données
Cel: +33 (0)6 74 15 56 53
http://dalibo.com - http://dalibo.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknZxUQACgkQo/dppWjpEvyi+wCeNAB3706M2iSwUJGMWAQsCWyi
YRgAoJKwDRq6esZeMmnFdOAtq2d4kqoP
=6mds
-----END PGP SIGNATURE-----


pgsql-bugs by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: Re: BUG #4749: trigonometric functions broken
Next
From: Heikki Linnakangas
Date:
Subject: Re: length() return wrong result