Altering a CHAR(4) column CHAR(5) changing pg_attribute

From: Denis Gasparin <denis(at)edistar(dot)com>
To: Postgresql General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Altering a CHAR(4) column CHAR(5) changing pg_attribute
Date: 2002-03-26 10:06:48
Message-ID: 1017137208.4772.11.camel@edspctec12
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table with a column of type CHAR(4) and I want to change the
column type to CHAR(5). This table is referenced by many other tables
and dropping it and recreating will be a massacre...

So I have had this idea:
why do not change the row of that column in the pg_attribute system
table?

In particular my idea is to change the atttypmod from 8 to 9 (I have
thought char(5) is larger 1 byte than char(4)...then...).

Is this possible? There will be bad consequences for my table?
If anyone has any tip...

The related row is:

attrelid = 18865
attname = channel
atttypid = 1042
attdispersion = 0.0022182
attlen = -1
attnum = 7
attnelems = 0
attcacheoff = -1
atttypmod = 8
attbyval = f
attstorage = x
attisset = f
attalign = i
attnotnull = t
atthasdef = f

Thank to everyone for your replies...
--
Doct. Eng. Denis Gasparin: denis(at)edistar(dot)com
---------------------------
Programmer & System Administrator - Edistar srl

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Achilleus Mantzios 2002-03-26 12:00:00 C Function with Arrays Question
Previous Message Ferruccio Zamuner 2002-03-26 09:11:57 Data integrity and sanity check