Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 856DD9FA4BB for ; Sun, 24 Dec 2006 15:13:14 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 92249-06 for ; Sun, 24 Dec 2006 15:13:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 9CDCF9FA4B4 for ; Sun, 24 Dec 2006 15:13:08 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id kBOJCqAn044916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 24 Dec 2006 12:12:54 -0700 (MST) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id kBOJCpZm046440; Sun, 24 Dec 2006 12:12:51 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id kBOJCpXJ046439; Sun, 24 Dec 2006 12:12:51 -0700 (MST) (envelope-from mfuhr) Date: Sun, 24 Dec 2006 12:12:51 -0700 From: Michael Fuhr To: Alexis Paul Bertolini Cc: pgsql-sql@postgresql.org Subject: Re: Changing character set when the damage is done Message-ID: <20061224191251.GA46309@winnie.fuhr.org> References: <458C6650.80105@computer.org> <1166831523.6369.308.camel@localhost.localdomain> <458EA551.3090008@computer.org> <20061224165734.GA43931@winnie.fuhr.org> <458EBC64.5040808@computer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <458EBC64.5040808@computer.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/168 X-Sequence-Number: 27124 On Sun, Dec 24, 2006 at 06:44:04PM +0100, Alexis Paul Bertolini wrote: > >SELECT convert(colname, 'utf8', 'latin1') FROM tablename; > > Yep, I meant the A with the tilde (the word cedilla sounded Spanish... > lol). Thanks, the "convert" function does the trick for me. If possible consider recreating the database with an encoding other than SQL_ASCII (e.g., LATIN1 or UTF8). If you do that, and if you set client_encoding appropriately when inserting and selecting data, then the database will convert the data automatically. > Using win1252 I get a "invalid destination encoding" error, but no > problem since I know for sure there aren't any euro signs. Versions 8.1 and later support win1252 so I'd guess you're using 8.0 or earlier. Consider upgrading to 8.1 or 8.2 for numerous improvements over earlier releases. http://www.postgresql.org/docs/8.1/interactive/release-8-1.html http://www.postgresql.org/docs/8.2/interactive/release-8-2.html -- Michael Fuhr