X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9BC51D1B16E for ; Thu, 15 Jul 2004 20:59:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 38109-07 for ; Thu, 15 Jul 2004 23:59:24 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 63AD4D1B16A for ; Thu, 15 Jul 2004 20:59:20 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i6FNxKb6008983; Thu, 15 Jul 2004 19:59:20 -0400 (EDT) To: Oliver Jowett Cc: "Dario V. Fassi" , "pgsql-jdbc@postgresql.org" Subject: Re: Very strange Error in Updates In-reply-to: <40F71495.20402@opencloud.com> References: <40F6172D.10301@sistemat.com.ar> <40F619A0.8030506@opencloud.com> <40F61CC2.5030704@sistemat.com.ar> <40F61F0E.6020907@opencloud.com> <20559.1089900977@sss.pgh.pa.us> <40F71495.20402@opencloud.com> Comments: In-reply-to Oliver Jowett message dated "Fri, 16 Jul 2004 11:34:45 +1200" Date: Thu, 15 Jul 2004 19:59:20 -0400 Message-ID: <8982.1089935960@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/196 X-Sequence-Number: 10580 Oliver Jowett writes: > Tom Lane wrote: >> Not really. SQL_ASCII encoding basically means "we don't know what this >> data is, just store it verbatim". So the UTF-8 string sent by the >> driver is stored verbatim. > Hmm, so SQL_ASCII is not really a first-class encoding -- it doesn't do > encoding conversions at all? Correct. BTW, setting client_encoding to SQL_ASCII also disables on-the-wire encoding conversions (so that client data had better be in whatever the database encoding is). > What about refusing to change client_encoding to something other than > SQL_ASCII on SQL_ASCII databases? Not sure that would do anything very useful. People who aren't thinking about this probably aren't thinking about setting client_encoding properly, either. > Or perhaps the JDBC driver could issue a warning whenever it notices the > underlying encoding is SQL_ASCII (this means another round-trip on > connection setup even when using V3 though). Something like this seems reasonable. I'm not sure why we didn't make server_encoding be GUC_REPORT so that it would be sent automatically during connection startup ... we could change that in 7.5 if it would help any ... > Sure -- it just depends on what other clients use the db. By the sounds > of it in this case the other client is an ODBC client that isn't aware > of encodings at all.. I suppose this can be handled by the default > client_encoding setting in postgresql.conf? Yeah, as long as there is one specific encoding that all the encoding-ignorant clients are using. If there's more than one, perhaps you could get it to work by specifying per-user or per-database default client_encoding settings (see ALTER USER and ALTER DATABASE). regards, tom lane