Re: Changing column types...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Changing column types...
Date: 2002-04-05 15:08:25
Message-ID: 24045.1018019305@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> writes:
>> Hmm. Seems like that case, and the various ones involving adjustment of
>> char/varchar length by hacking atttypmod, would be useful to support via
>> ALTER COLUMN even if we don't have a full implementation. Essentially
>> this would be taking the existing folklore about safe ways to hack
>> pg_attribute and reducing them to code --- why not do it?

> Can you only reduce the length of a varchar (say) or can you actually
> increase them as well?

You can go either way. If you're reducing then in theory you should
scan the column and make sure that no current values exceed the new
limit.

For char() as opposed to varchar(), you actually need to update the
column to establish the correctly-padded new values.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-04-05 15:12:54 Re: Changing column types...
Previous Message Jan Wieck 2002-04-05 15:04:09 Re: timeout implementation issues