Re: Resize varchar column

From: "John Sidney-Woollett" <johnsw(at)wardbrook(dot)com>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: johnsw(at)wardbrook(dot)com, "Bruno Wolff III" <bruno(at)wolff(dot)to>, pgsql-general(at)postgresql(dot)org
Subject: Re: Resize varchar column
Date: 2004-02-04 17:11:14
Message-ID: 3070.192.168.0.64.1075914674.squirrel@mercury.wardbrook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton said:
> The message (one of them anyway) you want is:
>
> http://archives.postgresql.org/pgsql-general/2001-10/msg01208.php
>
> Try and find something more recent though, in case anything important has
> changed. Oh, and do take Tom's advice about the backup.

Thanks, that's great.

It would be nice if there was a command available that would do simple
column resizes (upwards), or even data type changes (assuming no implied
data truncation), ie

alter table T alter column X varchar(x);

where x is the new size, and x > old size;

In fact, looking at your URL above (and using the technique explained), it
may be possible to create a function that does this.

I wonder if it works, though, if there is an index on the column...

Anyway, this time, I dropped and recreated the table as this is a test
system. But reinstating all the objects that referenced that table was a
pain!

Thanks again.

John Sidney-Woollett

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guy Fraser 2004-02-04 17:54:49 Re: Copy and xml files
Previous Message Richard Huxton 2004-02-04 17:07:25 Re: Resize varchar column