Re: problems with special characters

From: Rodrigo E(dot) De León Plicet <rdeleonp(at)gmail(dot)com>
To: kguardado(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problems with special characters
Date: 2008-12-02 05:35:19
Message-ID: a55915760812012135h74b455dck8f2b59a63aa0c7b4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 26, 2008 at 3:36 PM, Karina Guardado <kguardado(at)gmail(dot)com> wrote:
> I have a problem I have created a database with encoding SQL_ASCII and when
> I insert the data using a terminal in linux and insert the data for example
> Insert into mytable values(1,'Eléctrico'); it works fine but if I try to
> copy this data from a text file doing \copy mytable from textfile, it insert
> the data but instead of é writes a ? and I don't have any idea how to copy
> the data without this problem.

From the horse's mouth:

"The SQL_ASCII setting behaves considerably differently from the other
settings. When the server character set is SQL_ASCII, the server
interprets byte values 0-127 according to the ASCII standard, while
byte values 128-255 are taken as uninterpreted characters. No encoding
conversion will be done when the setting is SQL_ASCII. Thus, this
setting is not so much a declaration that a specific encoding is in
use, as a declaration of ignorance about the encoding. In most cases,
if you are working with any non-ASCII data, it is unwise to use the
SQL_ASCII setting, because PostgreSQL will be unable to help you by
converting or validating non-ASCII characters."

Source: http://www.postgresql.org/docs/8.3/static/multibyte.html

In other words, use a server encoding that works with your set of
non-ASCII characters.

Good luck.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2008-12-02 05:37:51 Re: Favorite Tom Lane quotes
Previous Message Sebastian Tennant 2008-12-02 05:24:41 Re: Detecting changes to certain fields in 'before update' trigger functions