Thread: Change type

Change type

From
"Vladimir S. Petukhov"
Date:
Hi!

Sorry for my English..

I want to dinamcly change type of column. If possible, of course.
Trivial idia - create new temporary column, try to write value from old columt
to temporarity (if type conersion ok - this made using select/update command
and type conversion checks on client's side), then delete old column, and
rename temporary column..
 But this decision looked quite ill...

Do you have better idea?

--
Я доcтаю из шиpоких штанин,
В котоpых гpажданка одета,
Воcемь ноpмальных. И двадцать один
Запpещенных к ношенью пpедмета!

Now playing: 03 - Lara And Reyes - Exotico.mp3
   AutoGenerated by fortune & xmms...

Re: Change type

From
Michael Fuhr
Date:
On Tue, Jan 18, 2005 at 07:01:45PM +0000, Vladimir S. Petukhov wrote:

> I want to dinamcly change type of column. If possible, of course.

The FAQ discusses this:

http://www.postgresql.org/files/documentation/faqs/FAQ.html#4.4

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: Change type

From
Oleg Bartunov
Date:
This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---559023410-538851280-1106072734=:12633
Content-Type: TEXT/PLAIN; charset=koi8-r; format=flowed
Content-Transfer-Encoding: 8BIT

On Tue, 18 Jan 2005, Vladimir S. Petukhov wrote:

> Hi!
> Sorry for my English..
> I want to dinamcly change type of column. If possible, of course.Trivial idia - create new temporary column, try to
writevalue from old columt to temporarity (if type conersion ok - this made using select/update command and type
conversionchecks on client's side), then delete old column, and rename temporary column.. But this decision looked
quiteill... 
> Do you have better idea?

hmm,

you may use generic type like 'varchar' to store your data

> -- Я доcтаю из шиpоких штанин,В котоpых гpажданка одета,Воcемь ноpмальных. И двадцать одинЗапpещенных к ношенью
пpедмета!
> Now playing: 03 - Lara And Reyes - Exotico.mp3   AutoGenerated by fortune & xmms...
> ---------------------------(end of broadcast)---------------------------TIP 9: the planner will ignore your desire to
choosean index scan if your      joining column's datatypes do not match 
>

     Regards,
         Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
---559023410-538851280-1106072734=:12633--