pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ProblemWithCharsOSX
2+ messages / 2 participants
[nested] [flat]

* ProblemWithCharsOSX
@ 2012-08-15 15:19  Angel Zúñiga <junior@ciencias.unam.mx>
  0 siblings, 1 reply; 2+ messages in thread

From: Angel Zúñiga @ 2012-08-15 15:19 UTC (permalink / raw)
  To: pgsql-bugs

Hi there,

I'm a PostgreSQL user in the linux world but at the office there is a Mac
computer and I have a problem with postgres in it.

The problem is when I use characters with tildes in spanish like in the
follow word "países".
The next is ilustrates my problem:

test=# SHOW SERVER_ENCODING;
 server_encoding
-----------------
 UTF8
(1 row)

test=# SELECT pg_client_encoding();
 pg_client_encoding
--------------------
 UTF8
(1 row)

test=# CREATE TABLE países (nombre VARCHAR(10));
CREATE TABLE
test=# \d
        List of relations
 Schema | Name  | Type  | Owner
--------+-------+-------+--------
 public | pases | table | dragon
(1 row)

The table name is created without the "í" character but if I enclose the
string between quotes postgres works fine.
test=# CREATE TABLE "países" (nombre VARCHAR(10));
CREATE TABLE
test=# \d
        List of relations
 Schema |  Name  | Type  | Owner
--------+--------+-------+--------
 public | países | table | dragon
 public | pases  | table | dragon
(2 rows)
test=# \l
                                     List of databases
      Name       |  Owner   | Encoding |  Collation  |    Ctype    |
Access privileges
-----------------+----------+----------+-------------+-------------+-----------------------
 template0       | postgres | UTF8     | es_MX.UTF-8 | es_MX.UTF-8 |
=c/postgres          +
                 |          |          |             |             |
postgres=CTc/postgres
 template1       | postgres | UTF8     | es_MX.UTF-8 | es_MX.UTF-8 |
postgres=CTc/postgres+
                 |          |          |             |             |
=c/postgres
 test            | dragon   | UTF8     | es_MX.UTF-8 | es_MX.UTF-8 |


In the linux box all works fine, so I think the problem is something
particular to Mac,
The Mac OS X version is 10.7.4.
Darwin Users-iMac.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr  9
19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64

and the postgres version is 9.0.8.

Can Anybody help me with my problem?

Thanks in advance,
Angel

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: ProblemWithCharsOSX
@ 2012-08-16 00:37  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Angel Zúñiga <junior@ciencias.unam.mx>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2012-08-16 00:37 UTC (permalink / raw)
  To: Angel Zúñiga <junior@ciencias.unam.mx>; +Cc: pgsql-bugs

=?ISO-8859-1?B?QW5nZWwgWvrxaWdh?= <junior@ciencias.unam.mx> writes:
> I'm a PostgreSQL user in the linux world but at the office there is a Mac
> computer and I have a problem with postgres in it.

> The problem is when I use characters with tildes in spanish like in the
> follow word "países".
> The next is ilustrates my problem:

> test=# SHOW SERVER_ENCODING;
>  server_encoding
> -----------------
>  UTF8
> (1 row)

> test=# SELECT pg_client_encoding();
>  pg_client_encoding
> --------------------
>  UTF8
> (1 row)

> test=# CREATE TABLE países (nombre VARCHAR(10));
> CREATE TABLE
> test=# \d
>         List of relations
>  Schema | Name  | Type  | Owner
> --------+-------+-------+--------
>  public | pases | table | dragon
> (1 row)

FWIW, I cannot reproduce that as stated on my own Mac.  I suspect though
that the problem is not with Postgres per se but with your terminal
window.  If you're using Terminal, check the encoding setting in
Preferences ... Settings, and also look at Preferences ... Encodings.
You'll probably have trouble unless Terminal is using the same encoding
that psql thinks the client_encoding is.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-08-16 00:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15 15:19 ProblemWithCharsOSX Angel Zúñiga <junior@ciencias.unam.mx>
2012-08-16 00:37 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox