pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CoL <col@mportal.hu>
To: pgsql-sql@postgresql.org
Subject: Re: URGENT!!! changing Column size
Date: Mon, 27 Oct 2003 18:48:30 +0100
Message-ID: <bnjlg9$1kv9$1@news.hub.org> (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>

Hi,

mohan@physics.gmu.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.




view thread (10+ messages)  latest in thread

Message-ID: <bnjlg9$1kv9$1@news.hub.org>
Permalink:  ../bnjlg9$1kv9$1@news.hub.org/
Also on:    postgresql.org/message-id/bnjlg9$1kv9$1@news.hub.org

 · 

reply

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: col@mportal.hu
  Subject: Re: URGENT!!! changing Column size
  In-Reply-To: <bnjlg9$1kv9$1@news.hub.org>

* 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