Re: change column length, is it that hard?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Arts <ron(dot)arts(at)neonova(dot)nl>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: change column length, is it that hard?
Date: 2005-07-30 20:19:45
Message-ID: 8066.1122754785@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Ron Arts <ron(dot)arts(at)neonova(dot)nl> writes:
> One of the tables contains a field username character varying(16)
> that needs to become varying(40), so just a little longer.

The traditional solution to this is to hack the pg_attribute.atttypmod
value for the column. I *strongly* recommend practicing on a scratch
database before you do this for real --- wrapping the whole thing in a
transaction so you can roll it back is a good idea, too.

> NOTICE: rule _RETURN on view ox_deps depends on table contact column username
> NOTICE: view ox_deps depends on rule _RETURN on view ox_deps

If you've got dependent views then you need to think about whether their
output column types need to change too.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ron Arts 2005-07-30 21:30:33 Re: change column length, is it that hard?
Previous Message Ron Arts 2005-07-30 18:37:29 change column length, is it that hard?