Re: convert char to varchar

From: "Peter Koczan" <pjkoczan(at)gmail(dot)com>
To: "Kostis Mentzelos" <mentzelos(at)gmx(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: convert char to varchar
Date: 2007-10-18 15:35:40
Message-ID: 4544e0330710180835h70aae76cm149bb671fed086ae@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Koczan 2007-10-18 15:37:10 Re: convert char to varchar
Previous Message Anibal David Acosta 2007-10-18 15:29:28 Cycling redundancy check error in dump file