Re: URGENT!!! changing Column size

From: CoL <col(at)mportal(dot)hu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: URGENT!!! changing Column size
Date: 2003-10-27 17:48:30
Message-ID: bnjlg9$1kv9$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

mohan(at)physics(dot)gmu(dot)edu wrote, On 10/27/2003 6:10 PM:

> Hi can we change the size of a column in postgres. I have a table named
> institution and column name is name varchar2(25), i want to change it to
> varchar2(50). Please let me know.

1 solution:

begin;
create temporary table temp as select * from mytable;
drop table mytable;
create table mytable (name varchar(50));
insert into mytable select CAST(name AS varchar(50)) from temp;
drop table temp;
commit;

C.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Stainburn 2003-10-27 17:50:03 Re: URGENT!!! changing Column size
Previous Message Tomasz Myrta 2003-10-27 17:46:36 Re: URGENT!!! changing Column size