Re: [JDBC] Conversion between UNICODE and LATIN1 is not supported

Поиск
Список
Период
Сортировка
От Andreas Joseph Krogh
Тема Re: [JDBC] Conversion between UNICODE and LATIN1 is not supported
Дата
Msg-id 200212190846.43267.andreak@officenet.no
обсуждение исходный текст
Список pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 19 December 2002 08:37, you wrote:
> Andreas Joseph Krogh wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi all!
> > I get the following error when trying to connect to a pg-7.3 database on
> > Solaris8 with the 7.3 JDBC-driver.
> > Here is my output on the Solaris box:
> > www=> select version();
> >                                 version
> > - -----------------------------------------------------------------------
> >  PostgreSQL 7.3 on sparc-sun-solaris2.8, compiled by GCC gcc (GCC) 3.2
> > (1 row)
> >
> > www=> set client_encoding = 'UNICODE';
> > ERROR:  Conversion between UNICODE and LATIN1 is not supported
>
> This is not JDBC interface, it is PSQL command line utility!
>
> The message most likely is due to your database being LATIN1 encoded and I
> must agree with PostgreSQL - Unicode cannot be converted to Latin1, not all
> of it.
>
> So, check the database encoding: "psql -l".

I'm sorry if I was unclear, I initially got the error using the JDBC-driver 
which issues the commands:        java.sql.ResultSet acRset =            ExecSQL("set client_encoding = 'UNICODE'; show
autocommit");
        //set encoding to be unicode        encoding = Encoding.getEncoding("UNICODE", null);
        if (!acRset.next())        {            throw new PSQLException("postgresql.con.failed", "failed getting 
autocommit status");        }

in AbstractJdbc1Connection.openConnection()

I had to recompile the JDBC-drivers with the method changed to 
"set client_encoding = 'LATIN1'", as my database is as you guessed created 
with "createdb -E LATIN1 dbname"

Then I realised I could reproduse it from the psql cmd-line, and posted the 
error I got from there. Sorry for the confusion.

But my question still stands, why does this work on Linux and not Solaris8? 
The docs say PostgreSQL can convert to and from LATIN1<->UNICODE as long as 
multibyte support is enabled, which it is default in 7.3.

- -- 
Andreas Joseph Krogh <andreak@officenet.no>
The difference between insanity and genius is measured by success
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+AXljUopImDh2gfQRAlnYAJkBD+9kBPH8ME0doqOPctHApgHLowCeKkxK
5m5GngiT8tW7gUAPPTRV9JI=
=Hosd
-----END PGP SIGNATURE-----



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Philip Warner
Дата:
Сообщение: Re: v7.3.1 tar ready ... please check it ...
Следующее
От: Tommi Maekitalo
Дата:
Сообщение: link to latest on ftp-site