From: Adam B. <ad...@po...> - 2002-04-17 22:27:30
|
Hi, > Cc-ing Adam, because he showed interest in this topic. :^) I am really impressed by the work You've done! I like this patch very much and I certainly will use this new featue in my projects. I promise to test it thoroughly, however not before weekend, I'm afraid. I'd like also to rewrite my ISO 8859-2 tests for pyPgSQL, which I wrote several months ago and submitted to Billy G. Allie. > A short example from the testcases to whet your appetite: >=20 > text1 =3D unicode("=D6sterreich-", "latin1") > text2 =3D unicode("Ungarn", "ascii") >=20 > conn =3D PgSQL.connect(host=3Dhost, database=3Ddbname, client_encod= ing=3D("utf-8",), unicode_results=3D1) > cursor =3D conn.cursor() > cursor.execute("set client_encoding to unicode") Is it really necessary to pass the information about encoding twice (once for PgSQL and second time for PostgreSQL)? Personally I'd like to see PgSQL deal with it completely: the module should send an appropriate "set client_encoding" command to PostgreSQL automatically, just after connecting to the database and before beginning of the first transaction. I will insist on such behaviour, especially because PostgreSQL 7.3 will reset all SET commands to their initial states on transaction rollback (vide discussion on pgsql-hackers several days ago). The only thing which should be done is a simple map, which will convert Python encoding names to PostgreSQL encoding names. I am not right? :) Regards, --=20 Adam Buraczewski <ad...@po...> * Linux registered user #165585 GCS/TW d- s-:+>+:- a- C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K? w-- O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI? D G++ e+++>++++ h r+>++ y? |