X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1DEA18B9EAE for ; Fri, 18 Feb 2005 19:51:56 +0000 (GMT) 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 31577-05 for ; Fri, 18 Feb 2005 19:51:47 +0000 (GMT) Received: from vms046.mailsrvcs.net (unknown [206.46.252.46]) by svr1.postgresql.org (Postfix) with ESMTP id 232518B9C0E for ; Fri, 18 Feb 2005 19:51:48 +0000 (GMT) Received: from jfradkin ([66.15.127.235]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IC4001KNHUBS130@vms046.mailsrvcs.net> for pgsql-odbc@postgresql.org; Fri, 18 Feb 2005 13:51:48 -0600 (CST) Date: Fri, 18 Feb 2005 14:55:35 -0500 From: "Joel Fradkin" Subject: Re: encoding using the odbc driver In-reply-to: <20377.1108755611@sss.pgh.pa.us> To: "'Tom Lane'" Cc: Message-id: <000a01c515f3$d0b6e310$797ba8c0@jfradkin> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.186 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, MSGID_DOLLARS X-Spam-Level: *** X-Archive-Number: 200502/93 X-Sequence-Number: 4983 Very confused describes me. As I mentioned it chose SQL_ASCII by default the first time I created = the db. When I tried to back it up and restore it I got an error because the = test I was restoring it to (created using pgadmin instead of the command prompt = on the linux machine) WAS UNICODE. Honestly I am completely ignorant on this stuff (sorry but is it is = true). I got the impression that Unicode was better for our needs as my = understanding was it allowed larger chars to be stored. That being said, I did the next iteration of the database as Unicode and tried to load it with the MSSQL data (using the odbc driver). It failed on French strings we had in the database (this was confusing = as it had worked prior). After looking at it I isolated the issue to the = encoding being Unicode (the odbc driver loads the data base when the data base is SQL_ASCII, but not when it is Unicode; I thought I would want Unicode). Can you straighten me out here do I not need Unicode (in which case the = odbc works fine as is). If I should be using Unicode is there something I need to do to get the = odbc driver to work (the .net allowed me to specify Unicode on the connection string and worked). I appreciate all the help, and sorry if I am asking stupid questions = based on total ignorance, but I am making some progress. Joel "Joel Fradkin" writes: > I changed my encoding from SQL_ASCII to UNICODE. > I believe the Unicode is supposed to support more languages? I think you're missing the point. The SQL_ASCII setting isn't an encoding, really; it's a declaration of ignorance. In this setting the server will just store and regurgitate whatever character strings you send it. This will work fine, more or less, if all your clients use exactly the same encoding and you don't care about functions like upper()/lower(). When you use UNICODE (or any other setting) then the server tries to enforce that what's stored in the database is actually valid data per that encoding. It will also provide encoding conversion for clients who select a different specific client_encoding. But a client that sets client_encoding =3D SQL_ASCII defeats the conversion and will see whatever's stored in the database. If you flip between SQL_ASCII and other settings, on either end, without clearly understanding what's happening, you're likely to get very confused. regards, tom lane