pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: pgsql-sql@postgresql.org
Cc: eric@vianet-express.com.br
Subject: Re: alter column witdh
Date: Tue, 27 May 2003 17:07:11 +0200
Message-ID: <3ED37F1F.3060209@rodos.fzk.de> (raw)

 >
 > how can I alter the column width
 >
Something like

begin ;

alter table foo rename column b to b_old ;
alter table foo add column b_new character(20) ;
update foo set b_new = b_old ;
alter table foo drop column b_old ;
alter table foo rename column b_new to b ;

commit ;

does the trick. Refer to the archives too.

Regards, Christoph





view thread (3+ messages)  latest in thread

Message-ID: <3ED37F1F.3060209@rodos.fzk.de>
Permalink:  ../3ED37F1F.3060209@rodos.fzk.de/
Also on:    postgresql.org/message-id/3ED37F1F.3060209@rodos.fzk.de

 · 

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: ch@rodos.fzk.de, eric@vianet-express.com.br
  Subject: Re: alter column witdh
  In-Reply-To: <3ED37F1F.3060209@rodos.fzk.de>

* 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