By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,833 Members | 2,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,833 IT Pros & Developers. It's quick & easy.

encoding and parser: error?

P: n/a
Hi list

I am working with postgresql 7.1.3 and 7.3.4 and German characters. I
use only unicode databases.

When importing data from iso-latin-1 via psql I tried
drop table test;
create table test(nr int, text1 text, text2 text) ;
set client_encoding to 'latin1';
insert into test values(0,'these are all','German characters');
insert into test values(1,'--','abc');
insert into test values(2,'we insert','one German character');
insert into test values(3,'e.g.','');
insert into test values(4,'we insert','two German character');
insert into test values(5,'e.g.','');
so far ok, but when I try
insert into test values(6,'we insert','a very special address');
insert into test values(7,'----','6 /6,Basinky');

I got the prompt like
test1'#
telling me that some ' seems missing.

When I ignore that and continue
insert into test values(8,'again','two German characters');
insert into test values(9,'e.g.','');
select * from test;

everything seems OK !!

Moreover, when I use the metacommand

/encoding latin1
instead of the "set client_encoding" SQLcommand (which should be
equivalent,
everything goes OK right from the beginning.

Why? Some parser error?

Thank you for your help.

Regards,

Hubert


--
-------------------------------------------------------------------------------
Dr.-Ing. Hubert Frhlich
Bezirksfinanzdirektion Mnchen
Alexandrastr. 3, D-80538 Mnchen, GERMANY
Tel. :+49 (0)89 / 2190 - 2980
Fax :+49 (0)89 / 2190 - 2459
hu**************@bvv.bayern.de
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
=?ISO-8859-1?Q?Hubert_Fr=F6hlich?= <hu**************@bvv.bayern.de> writes:
Moreover, when I use the metacommand /encoding latin1
instead of the "set client_encoding" SQLcommand (which should be
equivalent,
everything goes OK right from the beginning.


They should be equivalent, but they are not --- psql needs to know the
encoding, and when you use SET it doesn't. (This is fixed for 7.4.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.