Re: [SQL] how to change the type

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: [SQL] how to change the type
Дата
Msg-id GNELIHDDFBOCMGBFGEFOAELBCAAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: [SQL] how to change the type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> char(N) does store the trailing spaces, so altering N would give
> unwanted results: again, existing values would read out with the old
> width until updated.  You could fix this by issuing
>
>     UPDATE tab SET col = col
>
> after tweaking the pg_attribute.atttypmod value.  (AFAICS, any "clean"
> implementation would have to do just that internally, with the same
> unpleasant space and speed implications as we've discussed for DROP
> COLUMN.)

Can I take this opportunity to give my little thought on operations like
these (alter column type, drop column, etc.?)

If the DBA had to issue these commands every 5 minutes, then the speed and
space implications would be bad, yeah.  However, if all I want to do is drop
a column once every 6 months, then I don't really care that the operation
might take a minute and might consume lots of disk space...


Chris



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

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: text -> time cast problem
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: pg_dump: Sorted output, referential integrity