Re: how to chane the type

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: how to chane the type
Дата
Msg-id GNELIHDDFBOCMGBFGEFOMEKMCAAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: how to chane the type  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: how to chane the type  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-sql
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?

Chris

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Stephan Szabo
> Sent: Friday, 7 December 2001 12:31 AM
> To: tinar
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] how to chane the type
>
>
>
> On Wed, 5 Dec 2001, tinar wrote:
>
> > i have created a table
> > userlist with fields username varchar(10)
> > now i want to change it to username varchar(30)
> > without dropping or recreating the table.
> > how do i do it?
>
> 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).
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>



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

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Trigger for logging stuff...
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: how to chane the type