Re: alter table is taking a long time

Поиск
Список
Период
Сортировка
Искать
От
Johan Nel
Тема
Re: alter table is taking a long time
Дата
Msg-id
850c8977-4d10-4170-b0a7-d8685c473e67@w19g2000yqk.googlegroups.com
Список
Дерево обсуждения
Re: alter table is taking a long time "stanciutheone@gmail.com" <stanciutheone@gmail.com>
Re: alter table is taking a long time Thom Brown <thombrown@gmail.com>
Re: alter table is taking a long time "Michael Harris" <michael.harris@ericsson.com>
Hi Sam,

Typo in my haste on initial mail.  attlen should actually be
atttypmod.

> > update pg_attribute set attlen = 4 + 
> > where attname = 'yourcolumnname'
update pg_attribute set ATTTYPMOD = 4 + 
where attname = 'yourcolumnname' and 

> It will also update *every* column with that name.  Something involving
> the "attrelid" would be much safer.  I'd use something like:
>
>   update pg_attribute set attlen = 4 + 
>   where attrelid = regclass 'your table name'
>     and attname  = 'yourcolumnname';

Yes I agree, that was why I initially said to do a couple of selects
before doint the update to ensure only the applicable columns get
updated.
>> Just first do some select statements to ensure you only
>> update what you really want to.

Regards,

Johan Nel
Pretoria, South Africa.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
В списке pgsql-general по дате отправления
От: Albe Laurenz
Дата:
От: Scott Mead
Дата:
FAQ