Unix Technical Forum

BUG #1537: alter table statement

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 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:39 AM
biju
 
Posts: n/a
Default BUG #1537: alter table statement


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:39 AM
Michael Fuhr
 
Posts: n/a
Default Re: BUG #1537: alter table statement

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)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:39 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #1537: alter table statement

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 09:39 AM
Michael Fuhr
 
Posts: n/a
Default Re: BUG #1537: alter table statement

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:53 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com