Re: Changing column types...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Changing column types...
Дата
Msg-id 24045.1018019305@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Changing column types...  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
>> Hmm.  Seems like that case, and the various ones involving adjustment of
>> char/varchar length by hacking atttypmod, would be useful to support via
>> ALTER COLUMN even if we don't have a full implementation.  Essentially
>> this would be taking the existing folklore about safe ways to hack
>> pg_attribute and reducing them to code --- why not do it?

> Can you only reduce the length of a varchar (say) or can you actually
> increase them as well?

You can go either way.  If you're reducing then in theory you should
scan the column and make sure that no current values exceed the new
limit.

For char() as opposed to varchar(), you actually need to update the
column to establish the correctly-padded new values.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Always the same ecpg bug - please (re)apply patch
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: timeout implementation issues