Re: URGENT!!! changing Column size

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: mohan(at)physics(dot)gmu(dot)edu, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: URGENT!!! changing Column size
Date: 2003-10-27 17:50:03
Message-ID: 200310271750.03143.gary.stainburn@ringways.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Monday 27 Oct 2003 5:10 pm, mohan(at)physics(dot)gmu(dot)edu wrote:
> 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.
>
> --Mohan

try

alter table institution add column newname varchar2(50);
update institution set newname = name;
alter table institution drop column namel;
alter table institution rename column newname to name;

>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Gary Stainburn

This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-10-27 19:01:31 Re: URGENT!!! changing Column size
Previous Message CoL 2003-10-27 17:48:30 Re: URGENT!!! changing Column size