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

* Client_encoding
@ 2010-12-23 14:14  Mark Watson <mark.watson@jurisconcept.ca>
  0 siblings, 2 replies; 3+ messages in thread

From: Mark Watson @ 2010-12-23 14:14 UTC (permalink / raw)
  To: pgsql-admin

Hello group,
Any suggestions as to how to fix this are greatly appreciated.
My setup is Vista, locally installed Postgres 8.4.6 in default folders with
db initialised as (server_encoding) UTF8, and databases created with default
encoding of WIN1252. My application program is behaving correctly using
libpq.dll. pgAdmin is configured with Preferences=>Font = Tahoma
windows-1252 and Query=>Font = Tahoma 9 windows-1252.

The test case:
1. Create a text file test.txt containing 1 line of 2 characters: éÉ  (acute
accented lowercase and uppercase e, hex(E9C9), valid win1252 characters.
2.
CREATE DATABASE dbtest
  WITH OWNER = postgres
       ENCODING = 'WIN1252'
       TABLESPACE = pg_default
       LC_COLLATE = 'French_Canada.1252'
       LC_CTYPE = 'French_Canada.1252'
       CONNECTION LIMIT = -1;
3. Open query window to database dbtest and import the file test.txt...
4.
CREATE TABLE test
(
  col_descr text
)
WITH (
  OIDS=FALSE
);
ALTER TABLE test OWNER TO postgres;
set client_encoding = 'WIN1252';
COPY test FROM 'C:\\pgtemp\\test.txt' with  delimiter as '|' csv;
select * from test;
5. Results (no errors reported):
--- col_descr
-- ----------------
--                 (1 row with nothing displayed, but the length of
col_descr = 2)
6. If I execute the query:
set client_encoding = 'UTF8';
select * from test;

The correct results are displayed.

Is there a way, in PgAdmin, to to display the results when client_encoding
is set to WIN1252 ?

- Mark




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

* Re: Client_encoding
@ 2010-12-23 14:32  Mark Watson <mark.watson@jurisconcept.ca>
  parent: Mark Watson <mark.watson@jurisconcept.ca>
  1 sibling, 0 replies; 3+ messages in thread

From: Mark Watson @ 2010-12-23 14:32 UTC (permalink / raw)
  To: pgsql-admin

Hello again,
Problem below solved if in fact PgAdmin only displays UTF8.

----------------------------------------------------------------
Hello group,
Any suggestions as to how to fix this are greatly appreciated.
My setup is Vista, locally installed Postgres 8.4.6 in default folders with
db initialised as (server_encoding) UTF8, and databases created with default
encoding of WIN1252. My application program is behaving correctly using
libpq.dll. pgAdmin is configured with Preferences=>Font = Tahoma
windows-1252 and Query=>Font = Tahoma 9 windows-1252.

The test case:
1. Create a text file test.txt containing 1 line of 2 characters: éÉ  (acute
accented lowercase and uppercase e, hex(E9C9), valid win1252 characters.
2.
CREATE DATABASE dbtest
  WITH OWNER = postgres
       ENCODING = 'WIN1252'
       TABLESPACE = pg_default
       LC_COLLATE = 'French_Canada.1252'
       LC_CTYPE = 'French_Canada.1252'
       CONNECTION LIMIT = -1;
3. Open query window to database dbtest and import the file test.txt...
4.
CREATE TABLE test
(
  col_descr text
)
WITH (
  OIDS=FALSE
);
ALTER TABLE test OWNER TO postgres;
set client_encoding = 'WIN1252';
COPY test FROM 'C:\\pgtemp\\test.txt' with  delimiter as '|' csv;
select * from test;
5. Results (no errors reported):
--- col_descr
-- ----------------
--                 (1 row with nothing displayed, but the length of
col_descr = 2)
6. If I execute the query:
set client_encoding = 'UTF8';
select * from test;

The correct results are displayed.

Is there a way, in PgAdmin, to to display the results when client_encoding
is set to WIN1252 ?

- Mark


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin 
________________________________________
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1170 / Virus Database: 426/3333 - Release Date: 12/23/10




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

* Re: Client_encoding
@ 2010-12-23 14:34  Guillaume Lelarge <guillaume@lelarge.info>
  parent: Mark Watson <mark.watson@jurisconcept.ca>
  1 sibling, 0 replies; 3+ messages in thread

From: Guillaume Lelarge @ 2010-12-23 14:34 UTC (permalink / raw)
  To: Mark Watson <mark.watson@jurisconcept.ca>; +Cc: pgsql-admin

Le 23/12/2010 15:14, Mark Watson a écrit :
> Hello group,
> Any suggestions as to how to fix this are greatly appreciated.
> My setup is Vista, locally installed Postgres 8.4.6 in default folders with
> db initialised as (server_encoding) UTF8, and databases created with default
> encoding of WIN1252. My application program is behaving correctly using
> libpq.dll. pgAdmin is configured with Preferences=>Font = Tahoma
> windows-1252 and Query=>Font = Tahoma 9 windows-1252.
> 
> The test case:
> 1. Create a text file test.txt containing 1 line of 2 characters: éÉ  (acute
> accented lowercase and uppercase e, hex(E9C9), valid win1252 characters.
> 2.
> CREATE DATABASE dbtest
>   WITH OWNER = postgres
>        ENCODING = 'WIN1252'
>        TABLESPACE = pg_default
>        LC_COLLATE = 'French_Canada.1252'
>        LC_CTYPE = 'French_Canada.1252'
>        CONNECTION LIMIT = -1;
> 3. Open query window to database dbtest and import the file test.txt...
> 4.
> CREATE TABLE test
> (
>   col_descr text
> )
> WITH (
>   OIDS=FALSE
> );
> ALTER TABLE test OWNER TO postgres;
> set client_encoding = 'WIN1252';
> COPY test FROM 'C:\\pgtemp\\test.txt' with  delimiter as '|' csv;
> select * from test;
> 5. Results (no errors reported):
> --- col_descr
> -- ----------------
> --                 (1 row with nothing displayed, but the length of
> col_descr = 2)
> 6. If I execute the query:
> set client_encoding = 'UTF8';
> select * from test;
> 
> The correct results are displayed.
> 
> Is there a way, in PgAdmin, to to display the results when client_encoding
> is set to WIN1252 ?
> 

Nope. The Font option in the Preferences tab doesn't set the font of the
grid. It'll do on next pgAdmin (major) release.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com



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


end of thread, other threads:[~2010-12-23 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-12-23 14:14 Client_encoding Mark Watson <mark.watson@jurisconcept.ca>
2010-12-23 14:32 ` Mark Watson <mark.watson@jurisconcept.ca>
2010-12-23 14:34 ` Guillaume Lelarge <guillaume@lelarge.info>

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