On Mon, Mar 14, 2005 at 01:20:06PM +0530, Biju wrote:
> I am using postgresql version 7.2.2
As Tom observed, you might be reading documentation for a later
version and are trying to do something that 7.2 doesn't support.
Here's a link to the 7.2 documentation:
http://www.postgresql.org/docs/7.2/interactive/index.htmlhttp://www.postgresql.org/docs/7.2/interactive/sql-altertable.html
> I tried to conver the datatype of a field in a table say test. and the test
> table say contains
> one field testid of integer. I wanted it to convert it to say date datatype.
> so i gave the query : alter table test alter testid date;
The ability to change a column's type with ALTER TABLE was added
in 8.0 (even so, the syntax you show is incorrect). Since you're
using 7.2, you'll have to use the method mentioned in the FAQ:
http://www.postgresql.org/docs/faqs.FAQ.html#4.3
However, you won't be able to cast the integer column directly to
date, so you'll have to use an expression that performs the desired
conversion.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/