Skip site navigation (1) Skip section navigation (2)

Making a varchar bigger

From: Derik Barclay <dbarclay(at)givex(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Making a varchar bigger
Date: 2004-12-23 22:13:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Hello Group,

I've run into a bit of a problem, I have a varchar(6) field that I now need to 
have as a varchar(12).

I am relatively new to postgres and am unsure how best to do this. What I 
would like to do is alter the meta-data directly. Change the value of 
atttypmod in pg_attribute directly. Initial tests look good, however I am 
unsure how safe this is. Or what else needs to be done? does it need to be 

I have looked at the sections on renaming/changing columns, though this is 
more a solid an option, I am dealing with millions of records and the 
downtime for the backfill is not acceptable.

I found some old post in here hinting at doing this, however the links in them 
are now dead.

Givex -
Derik Barclay <dbarclay(at)givex(dot)com>, Systems Software Engineer
+1 416 350 9660
+1 416 250 9661 (fax)


pgsql-general by date

Next:From: Greg StarkDate: 2004-12-23 22:22:24
Subject: Re: select as
Previous:From: Alvaro HerreraDate: 2004-12-23 22:11:44
Subject: Re: Very slow stored proc

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group