Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 4DE959FBC5E for ; Thu, 18 Oct 2007 12:35:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 87339-02 for ; Thu, 18 Oct 2007 12:35:46 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by postgresql.org (Postfix) with ESMTP id F1A469FBBA1 for ; Thu, 18 Oct 2007 12:35:45 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id m38so286260waf for ; Thu, 18 Oct 2007 08:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=2SL5fY/pljPSc5GKUOTtPbZpxqJWwy6WFINtk+MLeyg=; b=RXO4KYno5g3dl/ZTdDajENZ6WrL9b/qqjf4ROg2P0CNw/0OJIn6x6kmpbgVBm++R30JXW4Hjyp26fD7cSXAqjgBPPb2zNrPp7Jogwm3Y5AnIAFZvvZWCi5JF5EHwiL2JrZlBr+deGp51+McKhbxg8Uv9SVCijdyBnXnqZg4aT3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oTnZ93bH8jeCrNOAhtjOYEZdc1FffCtLU7ZpPzS/JMFUgBw4BU45lEPDjBVw+s6mDpgCaz3OPRpCw0hJxo+ZR7u+hhndeIHCZ56jlA+K1jfMFxVEtPchbnic8OMHd01ofwtpazWKcZleAD8v4y493yVfFR1goPWgh8k7J/btGcg= Received: by 10.114.109.1 with SMTP id h1mr801657wac.1192721740382; Thu, 18 Oct 2007 08:35:40 -0700 (PDT) Received: by 10.114.197.19 with HTTP; Thu, 18 Oct 2007 08:35:40 -0700 (PDT) Message-ID: <4544e0330710180835h70aae76cm149bb671fed086ae@mail.gmail.com> Date: Thu, 18 Oct 2007 10:35:40 -0500 From: "Peter Koczan" To: "Kostis Mentzelos" Subject: Re: convert char to varchar Cc: pgsql-admin@postgresql.org In-Reply-To: <4716EDD7.7010104@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4716EDD7.7010104@gmx.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/171 X-Sequence-Number: 27085 > Is there any other way to clear trailing spaces when I restore the table? If you're running 8.x, you can do this in place: ALTER TABLE c1 ALTER COLUMN name varchar(20) USING rtrim(name), ALTER COLUMN date varchar(20) USING rtrim(date); This could take a long time if the table is large or has a lot of indexes on it. Peter