Re: How to modify type in table?

From: "Albert REINER" <areiner(at)tph(dot)tuwien(dot)ac(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to modify type in table?
Date: 2001-02-05 17:39:19
Message-ID: 20010205183919.B1866@frithjof
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Saluton,

On Tue, Jan 30, 2001 at 10:22:23AM +0700, Jaruwan Laongmal wrote:
> Dear Sir.
> Would you like to inform me how to modify type in table?
> For example , I define type as varchar(14) , but I want to modify to varchar(120). How to do this.

If it is not too much data, the easiest would be to use pg_dump to
dump the database (or just the table), edit the definition, and feed
the changed file to psql in order to get the data back. Or you can
create a different table with the correct structure, copy the data
there, drop the old table, rename the new one to the correct one.

Albert.

--

--------------------------------------------------------------------------
Albert Reiner <areiner(at)tph(dot)tuwien(dot)ac(dot)at>
Deutsch * English * Esperanto * Latine
--------------------------------------------------------------------------

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-02-05 17:43:46 Re: timestamp in pg_dump
Previous Message Lamar Owen 2001-02-05 17:32:04 Re: pg_ctl wish list

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2001-02-05 18:42:45 Re: RE: C function for use from PLpgSQL trigger
Previous Message keith 2001-02-05 17:16:07 Re: Problem with Day of Week