This is a discussion on BUG #1537: alter table statement within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1537 Logged by: biju Email address: biju@analytica-india.com PostgreSQL version: 7.2.2 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| The following bug has been logged online: Bug reference: 1537 Logged by: biju Email address: biju@analytica-india.com PostgreSQL version: 7.2.2 Operating system: linux-gnu Description: alter table statement Details: i tried to execute alter table statement for a particular table. i did it many ways, but not worked. i tried with the same syntax given in the postgresql manual but in vain.... can u suggest anything abt this... Thanks ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings |
| |||
| On Fri, Mar 11, 2005 at 11:12:07AM +0000, biju wrote: > PostgreSQL version: 7.2.2 This version is pretty old -- if you must use 7.2, then consider upgrading to 7.2.7. Better yet, try a newer release like 8.0.1. > i tried to execute alter table statement for a particular table. i did it > many ways, but not worked. Please show the exact statement you executed and describe how it didn't work. If you got an error message, then please copy and paste it verbatim. Without more information we can't tell you what's wrong. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) |
| |||
| Michael Fuhr <mike@fuhr.org> writes: > On Fri, Mar 11, 2005 at 11:12:07AM +0000, biju wrote: >> i tried to execute alter table statement for a particular table. i did it >> many ways, but not worked. > Please show the exact statement you executed and describe how it > didn't work. If you got an error message, then please copy and > paste it verbatim. Without more information we can't tell you > what's wrong. I'll make a side bet that he's reading post-7.2 documentation and expecting every feature therein to be in 7.2 ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| ||||
| 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/i...ive/index.html http://www.postgresql.org/docs/7.2/i...ltertable.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/ ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |