Re: how to chane the type

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: how to chane the type
Дата
Msg-id 20011206180253.J30180-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: how to chane the type  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список pgsql-sql
On Fri, 7 Dec 2001, Christopher Kings-Lynne wrote:

> What's the essential problem with changing column types in postgres?  Is it
> similar to the DROP COLUMN problem?
>
> If the answer is that the table format only has allocated enough space per
> row for the existing type, then how is it possible that Stephen's hack below
> will not break things?

The hack below only works to change the max length of variable length
attributes and only upward.  I'd be very wary of trying to change the real
type of a value except between ones that are bitwise compatible (like I
think varchar and text are technically, but I'm not sure).

> > The best way is to recreate the table and rename
> > them around.  If you *REALLY* don't want to do
> > that and have a recent backup (yes, I'm serious),
> > you can muck with pg_attribute and change
> > atttypmod for the attribute in question
> > (from 14 to 34).



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

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: how to chane the type
Следующее
От: "David M. Richter"
Дата:
Сообщение: Vacuum analyze decreases speed