Re: Changing data types

From: "Gowey, Geoffrey" <ggowey(at)rxhope(dot)com>
To: "Gowey, Geoffrey" <ggowey(at)rxhope(dot)com>, "'Alex Pilosov'" <alex(at)pilosoft(dot)com>
Cc: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Changing data types
Date: 2001-09-24 14:55:54
Message-ID: E15F4B031E17D5118B18009027F67927DAF8@SERVER
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

One thought did just occur to me. It is at least theoretically possible to
simplisticly migrate on column type to another by reading in the data and
oid of the row into a struct, drop the column, create a new column with the
correct data type, and populate. This is ugly, but it is better than saying
"no, you can't".

Geoff

-----Original Message-----
From: Gowey, Geoffrey
Sent: Monday, September 24, 2001 10:53 AM
To: 'Alex Pilosov'; Gowey, Geoffrey
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: RE: [HACKERS] Changing data types

>This is not for -hackers.

How so?

>And the answer is "no, you can't". Recreate the table with correct types
>and insert the old values into it.

You're kidding me, right? *prepares to gargle* MS Sql server can. Surely
we can implement this feature or aren't we aiming to go head to head with
commercial rdbms'?

>>On Mon, 24 Sep 2001, Gowey, Geoffrey wrote:

>> I posted this in my last message, but have not heard anything yet so I'm
>> wondering if it was overlooked. I need to know how to change a column
from
>> being say a varchar(9) to an integer. Does anyone know how to change the
>> data type?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2001-09-24 15:03:38 Re: Changing data types
Previous Message Gowey, Geoffrey 2001-09-24 14:53:02 Re: Changing data types