From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | Biju <biju(at)analytica-india(dot)com> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #1537: alter table statement |
Date: | 2005-03-14 11:58:05 |
Message-ID: | 20050314115805.GA20480@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
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.html
http://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/
From | Date | Subject | |
---|---|---|---|
Next Message | Manfred Koizar | 2005-03-14 12:40:38 | Re: [HACKERS] We are not following the spec for HAVING without GROUP |
Previous Message | Ales Vojacek | 2005-03-14 11:55:09 | BUG #1543: Problem with restore DB |