Re: Resize varchar column - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Resize varchar column
Date
Msg-id 20040204150859.GA19840@wolff.to
Whole thread Raw
In response to Resize varchar column  ("John Sidney-Woollett" <johnsw@wardbrook.com>)
Responses Re: Resize varchar column  ("John Sidney-Woollett" <johnsw@wardbrook.com>)
Re: Resize varchar column  (Dirk Försterling <r@zorbla.de>)
List pgsql-general
On Wed, Feb 04, 2004 at 14:45:37 -0000,
  John Sidney-Woollett <johnsw@wardbrook.com> wrote:
> Is it possible to alter a table to resize a varchar column? The PG docs
> indicate lots of uses for "alter table T alter column C..." but not one
> that allows the changing of the type (or same type, new size).
>
> This is possible in Oracle (provided you are increasing the column size).
>
> Is there a way to resize the column without having to drop or recreate the
> table or column?

It is possible to change the size of varchar data by updating the system
catalogs. I don't know the exact details of what to do, but the instructions
should be in the archives (multiple times).

In general (in 7.4.x) you can change data types using add, drop, rename and
a query to copy/translate the data. This will have the side effect of making
the updated column the last column when using * to refer to the table's columns.

pgsql-general by date:

Previous
From: "John Sidney-Woollett"
Date:
Subject: Resize varchar column
Next
From: Tom Lane
Date:
Subject: Re: Anyone has nls activated on Mac OS X?