Re: ALTERING A TABLE

From: Ron Peterson <rpeterson(at)yellowbank(dot)com>
To: Peter Landis <ntwebdeveloper(at)yahoo(dot)com>
Cc: postgreSQL general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: ALTERING A TABLE
Date: 2000-06-01 17:18:41
Message-ID: 39369AF1.F55C40CC@yellowbank.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Landis wrote:
>
> Hi-
> I'm a newbie at postgresql and ran into a
> situation on trying to alter an element in a table. I
> have a table called company where a field is called
> address. The address field is set to char() 20 and I
> want to alter the value to have an address field of
> 100. What would be the command to alter the table to
> change this field without affecting the data? If
> anyone could help I would greatly appreciate it.

You can't use ALTER TABLE to change a field's data description. You'll
have to make a new table. Then use SELECT INTO to move your data. Then
DROP TABLE oldtable. Then ALTER TABLE tablename RENAME TO newname.

-Ron-

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-06-01 17:21:34 Re: Postmaster won't -HUP
Previous Message Ed Loehr 2000-06-01 17:11:50 Re: Postmaster won't -HUP