×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ALTER TABLE

ALTER TABLE

ALTER TABLE

(OP)
Hey forum
This should be easy but I have PBKAC.
Can annybody please help me with correct syntax ?
rate is presently varchar(15), need (25).
TIA's

CODE

ALTER TABLE phonecalls ALTER COLUMN rate TYPE varchar(25)

RE: ALTER TABLE

I don't see any error. You could omit the keyword "COLUMN" afaik, but it schouldn't be a problem:

ALTER TABLE phonecalls ALTER rate TYPE varchar(25);

Maybe an export would help, modify the varchar-width, and reimport.
Or add a column rate2 (vc25), fill with data from rate, delete rate, rename rate2 to rate?
 

don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html

RE: ALTER TABLE

Hi

Are you sure you are using PostgreSQL 8.x ? altering the type was not supported yet in 7.x version.

Personally I always do it the "long" way :

Quote (stefanwagner):

add a column rate2 (vc25), fill with data from rate, delete rate, rename rate2 to rate
An alternative I never recommend but my colleague uses, is to update the pg_attibute system table directly.

Feherke.
http://rootshell.be/~feherke/

RE: ALTER TABLE

(OP)

using pg 7.4.19
Thx for clues.  I shall do it the "long" way.
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close