Re: Field sizes and structure

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: "Williams, Travis L, NPONS" <tlw(at)att(dot)com>
Cc: Robert Fitzpatrick <robert(at)webtent(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Field sizes and structure
Date: 2002-12-10 05:23:55
Message-ID: 20021210052355.GC20231@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 09, 2002 at 06:04:57PM -0500, Williams, Travis L, NPONS wrote:
> do a \h on alter table (in psql) and you will get a big list of examples
> of how to alter a table.. so you can change it from say varchar(5) to
> varchar(25)..

No, that case isn't covered. You have to mess with pg_attribute's
atttypmod field for the attribute you want to change, manually. Note
that for VARCHAR and the like, it's length+4. Don't try to change it
without backups... or you will suffer the consequences (if you backup,
however, nothing harmful will happen -- this is a law of nature).

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El conflicto es el camino real hacia la union"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Çağıl Şeker 2002-12-10 07:54:43 md5 hash question (2)
Previous Message Justin Clift 2002-12-10 02:46:00 Re: publicly available PostGreSQL server?