Re: alter table workaround

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: alter table workaround
Дата
Msg-id 14886.1004585862@sss.pgh.pa.us
обсуждение исходный текст
Ответ на alter table workaround  (wsheldah@lexmark.com)
Список pgsql-general
wsheldah@lexmark.com writes:
> I just had to expand a column from varchar(10) to varchar(75).

If you want a quick hack, rather than a general-purpose solution,
it'd suffice to change the atttypmod value of the appropriate row
in pg_attribute.  Something along the line of

    update pg_attribute set atttypmod = 75 + 4
    where attname = 'columnname' and
    attrelid = (select oid from pg_class where relname = 'tablename');

Untested but I think it's right --- make a backup first (or else don't
blame me if you break your database ;-))

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error in date_trunc function?
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: Error in date_trunc function?