Re: ALTERING A TABLE - Mailing list pgsql-general

From Ron Peterson
Subject Re: ALTERING A TABLE
Date
Msg-id 39369AF1.F55C40CC@yellowbank.com
Whole thread Raw
In response to ALTERING A TABLE  (Peter Landis <ntwebdeveloper@yahoo.com>)
List 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-

pgsql-general by date:

Previous
From: Ed Loehr
Date:
Subject: Re: Postmaster won't -HUP
Next
From: Tom Lane
Date:
Subject: Re: Postmaster won't -HUP