From: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: mohan@physics.gmu.edu, <pgsql-sql@postgresql.org>
Subject: Re: URGENT!!! changing Column size
Date: Mon, 27 Oct 2003 17:50:03 +0000
Message-ID: <200310271750.03143.gary.stainburn@ringways.co.uk> (raw)
In-Reply-To: <64184.138.88.163.115.1067274631.squirrel@physics.gmu.edu>
References: <64184.138.88.163.115.1067274631.squirrel@physics.gmu.edu>
On Monday 27 Oct 2003 5:10 pm, mohan@physics.gmu.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@postgresql.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: gary.stainburn@ringways.co.uk
Subject: Re: URGENT!!! changing Column size
In-Reply-To: <200310271750.03143.gary.stainburn@ringways.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox