Re: JDBC driver, PGSQL 7.3.2 and accents characters

From: Barry Lind <blind(at)xythos(dot)com>
To: Mario Rodriguez Villanea <mrodriguez(at)AVANTICATEC(dot)NET>
Cc: Davide Romanini <romaz(at)libero(dot)it>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC driver, PGSQL 7.3.2 and accents characters
Date: 2003-03-19 20:18:55
Message-ID: 3E78D0AF.2020700@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Mario,

I do not know of any easy way. I believe the character set for a
database can only be set when the database is created. So you would
need to dump the data, drop and recreate the database with the correct
character set and then reload the data.

thanks,
--Barry

Mario Rodriguez Villanea wrote:
> Hi I've got the same problem, but my database is currently working, and
> I'm wondering if there is way to change with an SQL command
> like ALTER DATABASE ENCODING 'LATIN1' or somathing like that
>
> thanks
>
> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Barry Lind
> Sent: Wednesday, March 19, 2003 10:37 AM
> To: Davide Romanini
> Cc: pgsql-jdbc(at)postgresql(dot)org
> Subject: Re: [JDBC] JDBC driver, PGSQL 7.3.2 and accents characters
>
>
> Davide,
>
> Those characters are not part of the SQL_ASCII character set. SQL_ASCII
>
> is 7bit ascii, the characters you are trying to use are all 8bit
> characters. You need to create your database with a character set that
> supports the characters you are trying to store. LATIN1 or UNICODE
> would be good choices.
>
> thanks,
> --Barry
>
> Davide Romanini wrote:
>
>>Hi,
>>
>>I've nice problems with the jdbc driver. I've tried with the jdbc2,
>>jdbc, latest stable and also development release.
>>I've a database in postgres with some varchar fields. The database is
>>SQL_ASCII as char encoding. In that varchar fields I've stored also
>>names with accents such è, à, ì etc... They work fine using the psql
>>program, and also linking tables to access through the odbc driver.
>
> But
>
>>when I try to use jdbc to connect to database my accents fail to load.
>
>
>>For example I have the string 'Forlì Sud'. When I try to
>>system.out.println this string catched by jdbc with rs.getString, I
>
> see
>
>>this string instead of the original one: 'Forl?ud'.
>>I've tried also to use different character sets in the connection url
>>like ISO-8859-1, UNICODE, WIN, SQL_ASCII but didn't change anything.
>>
>>Please help me, because this bug makes java and jdbc pretty unusable
>
> to
>
>>connect pgsql databases.
>>
>>Bye, Romaz
>>
>>
>>---------------------------(end of
>
> broadcast)---------------------------
>
>>TIP 6: Have you searched our list archives?
>>
>>http://archives.postgresql.org
>>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Daniel Bruce Lynes 2003-03-19 23:11:03 Re: JDBC driver, PGSQL 7.3.2 and accents characters
Previous Message Dave Cramer 2003-03-19 20:00:57 Re: Follow-up OpenOffice and Postgres 7.3.2