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

Поиск
Список
Период
Сортировка
От Denis Gasparin
Тема Altering a CHAR(4) column CHAR(5) changing pg_attribute
Дата
Msg-id 1017137208.4772.11.camel@edspctec12
обсуждение исходный текст
Ответы Re: Altering a CHAR(4) column CHAR(5) changing pg_attribute  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список 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@edistar.com
---------------------------
Programmer & System Administrator - Edistar srl



В списке pgsql-general по дате отправления:

Предыдущее
От: Ferruccio Zamuner
Дата:
Сообщение: Data integrity and sanity check
Следующее
От: "Gyorgy Molnar"
Дата:
Сообщение: PL/pgsql return more than one values