Re: Determining client_encoding from client locale

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: Determining client_encoding from client locale
Date: 2009-08-18 11:49:25
Message-ID: 4A8A9545.5040705@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(I finally got a chance to get back to this...)

Jaime Casanova wrote:
> ok, attached a version that modifies src/interfaces/libpq/Makefile to
> push chklocale.o and eliminate the dependency on libpgport, this
> change also fixes the compile problem on windows

Thanks!

> still, i'm not sure this patch is doing anything useful... i
> initialized a cluster with utf8 and my system is using utf8 but when
> executing my test script with client_encoding=auto it gets SQL_ASCII
>
> postgres(at)casanova1:~/pg_releases/pgtests$ locale
> LANG=es_EC.UTF-8
> LC_CTYPE="es_EC.UTF-8"
> LC_NUMERIC="es_EC.UTF-8"
> LC_TIME="es_EC.UTF-8"
> LC_COLLATE="es_EC.UTF-8"
> LC_MONETARY="es_EC.UTF-8"
> LC_MESSAGES="es_EC.UTF-8"
> LC_PAPER="es_EC.UTF-8"
> LC_NAME="es_EC.UTF-8"
> LC_ADDRESS="es_EC.UTF-8"
> LC_TELEPHONE="es_EC.UTF-8"
> LC_MEASUREMENT="es_EC.UTF-8"
> LC_IDENTIFICATION="es_EC.UTF-8"
> LC_ALL=
> postgres(at)casanova1:~/pg_releases/pgtests$ ./test-libpq
> 'dbname=postgres port=54329 client_encoding=auto'
> client_encoding: SQL_ASCII
>
> and when executing the same script compiled in windows i get an error,
> it doesn't recognize the client_encoding option...
>
> $ ./test-libpq.exe "dbname=postgres user=postgres host=192.168.204.101
> port=54329 client_encoding=latin1"
> Connection to database failed: invalid connection option "client_encoding"

Hmm, are you sure you the right version of libpq is being loaded at
runtime? What does "ldd ./test-libpq" say?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-08-18 14:18:02 Re: Lazy Snapshots
Previous Message mahendra chavan 2009-08-18 11:39:48 Index Selection Tool For PostgreSQL