Skip site navigation (1) Skip section navigation (2)

Re: JDBC and Accents

From: Marko Kreen <marko(at)l-t(dot)ee>
To: Tony Grant <tony(at)animaproductions(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: JDBC and Accents
Date: 2001-04-27 13:24:59
Message-ID: 20010427152459.A30250@l-t.ee (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-jdbc
On Fri, Apr 27, 2001 at 02:37:48PM +0200, Tony Grant wrote:
> On 27 Apr 2001 14:26:14 +0200, Marko Kreen wrote:
> 
> > 
> > What is your database encoding?
> > 
> > You can insert whatever stuff you want into db and
> > psql displays it fine - it does not care what it is.
> > 
> > But JDBC 7.1 does use database encoding for understanding
> > stuff it gets and translating it to Java strings.  So if your
> > db encoding is SQL_ASCII but data is LATIN1 you are screwed.
> > Same with data in LATIN1 and db in UNICODE.  etc...
> 
> How do I set it?

initdb --ecnoding ENC	sets the template* encoding, this gets
	used when you dont specify the encoding in db creation
	time.

CREATE DATABASE xx WITH ECCODING='ENC';
createdb xx --encoding ENC
	same thing, sets the new database encoding.

and there is commands
	SET CLIENT_ENCODING='ENC';
	SET SERVER_ENCODING='ENC';

which set the encoding for one session.  SERVER_ENCODING is
r/o though.  CLIENT_ENCODING Im not so sure, probably
commands the server to do on-the-fly encoding conversion
for client.  I expect this needs correct database encoding...


> Searching docs for "database encoding" gives:
> 
> Sorry, but search returned no results.

It _is_ documented somewhere but I cant do much
surfing at the moment coz Iam sitting behind a 80x25 Video
Terminal...

> 
> Is this the locale value that can be passed at start up? I will document
> this in my Ultradev - Posgresql HOWTO because it is JDBC related.

Look in docs help for above commands.

-- 
marko


In response to

pgsql-jdbc by date

Next:From: Marko KreenDate: 2001-04-27 13:32:45
Subject: Re: JDBC and Accents
Previous:From: Tony GrantDate: 2001-04-27 13:10:58
Subject: Re: JDBC and Accents

pgsql-general by date

Next:From: Marko KreenDate: 2001-04-27 13:32:45
Subject: Re: JDBC and Accents
Previous:From: Jelle OuwerkerkDate: 2001-04-27 13:23:39
Subject: rotating log files

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group