X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 11D61D1F0A9 for ; Tue, 4 May 2004 11:34:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 84474-06 for ; Tue, 4 May 2004 11:33:40 -0300 (ADT) Received: from lakermmtao09.cox.net (lakermmtao09.cox.net [68.230.240.30]) by svr1.postgresql.org (Postfix) with ESMTP id DAFF2D1F09C for ; Tue, 4 May 2004 11:33:35 -0300 (ADT) Received: from [10.0.1.2] (really [68.106.107.246]) by lakermmtao09.cox.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20040504143338.ESMT5659.lakermmtao09.cox.net@[10.0.1.2]>; Tue, 4 May 2004 10:33:38 -0400 In-Reply-To: <200405041011713.SM01600@Pedro> References: <200405041011713.SM01600@Pedro> Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <08BAE2E0-9DD8-11D8-91BC-000A95C580C4@comcast.net> Content-Transfer-Encoding: 7bit Cc: From: douglas morrison Subject: Re: Bad character data Date: Tue, 4 May 2004 10:33:39 -0400 To: "Noah Davis" X-Mailer: Apple Mail (2.613) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/29 X-Sequence-Number: 13345 well if that truly is the case, then maybe the different ssh clients are expecting the chars to be in a specific encoding... The web browser view can be fixed using php, jsp, coldfusion or whatever your middleware tier is to translate the data properly. On May 4, 2004, at 10:09 AM, Noah Davis wrote: > I'm using psql through putty (an ssh client). Someone reported using > MindTerm as their ssh client and saw the characters ok...? Weird. But > they > are definitely screwed up when viewed through the ultimate client (web > browser). > > -----Original Message----- > From: pgsql-admin-owner@postgresql.org > [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of douglas morrison > Sent: Monday, May 03, 2004 7:11 PM > To: Noah Davis > Cc: pgsql-admin@postgresql.org > Subject: Re: [ADMIN] Bad character data > > no problem noah, > > been there inheriting bad data, suXX0r. wish i could be of more help. > if all else fails look at the translate() function to replace the > offending > chars... dunno what i can do, but which type of client are you > currently > using? > > -- > doug > > > On May 3, 2004, at 4:55 PM, Noah Davis wrote: > >> Hi Doug, >> >> Thanks for the response. I do realize it's not the ideal situation, >> but it's the database I inherited, so not much I can do there :) . I >> tried the to_ascii and it doesn't seem to help much. It may be that I >> can try a different client and get more legible characters. Not sure. >> >> -----Original Message----- >> From: douglas morrison [mailto:luckycat@comcast.net] >> Sent: Monday, May 03, 2004 4:38 PM >> To: Noah Davis >> Cc: pgsql-admin@postgresql.org >> Subject: Re: [ADMIN] Bad character data >> >> The lack of responses is prolly because this sort of thing is usually >> handled by the client... The client for input should be >> stripping/converting to ASCII/unicode whichever chars are unwanted and >> notifying the user if anything is removed/unusable. The client for >> display should then be able to parse the chars correctly... >> >> You might be able to use your current data if you change your SELECT >> to something like: >> >> SELECT to_ascii(columnName, 'LATIN1') AS convertedColumn >> FROM tableName; >> >> >> hth, >> doug >> >> >> >> On May 3, 2004, at 3:23 PM, Noah Davis wrote: >> >>> I posted this to the pgsql general list, but alas, I did not get any >>> responses. Perhaps someone here could be of assistance? >>> >>> I have a database with some bad characters in it -- some users had >>> entered MS Word smart quotes, em dashes, foreign characters, and they >>> look like gibberish coming out of the database. Most important are >>> the smart quotes I guess. >>> >>> What's the best way to replace these characters? I thought I might be >>> able to run a simple SQL UPDATE command, but some of the gibberish >>> for different characters looks the same (at least from my client it >>> does), and it would clobber them all. >>> >>> I have a feeling there's some sort of ASCII code or unicode solution >>> to this problem, but I could use am little push in the right >>> direction. >>> >>> Thanks. >>> >>> Noah. >>> >>> >>> ---------------------------(end of >>> broadcast)--------------------------- >>> TIP 2: you can get off all lists at once with the unregister command >>> (send "unregister YourEmailAddressHere" to >>> majordomo@postgresql.org) >>> >> >> >> >> ---------------------------(end of >> broadcast)--------------------------- >> TIP 8: explain analyze is your friend >> > > > ---------------------------(end of > broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if > your > joining column's datatypes do not match >