altering a column

Started by Nonameover 22 years ago2 messagesgeneral
Jump to latest
#1Noname
treat00@yahoo.com

I need to change a varchar(32) to varchar(1024). It is a primary key
that many tables reference. How do I do this without reloading the
entire database?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: altering a column

treat00@yahoo.com (Thomas Reat) writes:

I need to change a varchar(32) to varchar(1024). It is a primary key
that many tables reference. How do I do this without reloading the
entire database?

When your back is to the wall, you can hack the pg_attribute.atttypmod
for the column (this is sufficient in this particular case). See
archives for discussion, and please heed the advice to experiment in
a scratch database.

regards, tom lane