Hi,
Is it possible to alter the type of a column in a table?
For example changing an INT to a VARCHAR.
How would I do this using PostgreSQL.
Thanks.
Lou
alter column type
Moderator: General Moderators
-
forgodsake8
- Forum Newbie
- Posts: 9
- Joined: Fri Feb 27, 2004 8:30 pm
Column | Type | Modifiers
--------------+-----------------------------+----------------------------------------------------------------
advert_id | integer | not null default nextval('public.advert2_advert_id_seq'::text)
username | character varying |
mod_book_id | character varying |
asking_price | integer |
condition | character varying |
date_added | timestamp without time zone |
description | character varying |
advert_type | character varying(2)
I basically want to change asking_price to a format where it can accept 12.50 for example...would i need to use float??
--------------+-----------------------------+----------------------------------------------------------------
advert_id | integer | not null default nextval('public.advert2_advert_id_seq'::text)
username | character varying |
mod_book_id | character varying |
asking_price | integer |
condition | character varying |
date_added | timestamp without time zone |
description | character varying |
advert_type | character varying(2)
I basically want to change asking_price to a format where it can accept 12.50 for example...would i need to use float??
I removed my posts as I misread your original post and question. I'm now realizing that I was trying to help you achieve this using the MySQL way and not the PostgreSQL way.
I'm sincerely sorry for misleading you.
Might find point 4 on this page interesting (the entire page actually): http://techdocs.postgresql.org/techdocs ... olumns.php
I'm sincerely sorry for misleading you.
Might find point 4 on this page interesting (the entire page actually): http://techdocs.postgresql.org/techdocs ... olumns.php