pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Franco Bruno Borghesi <franco@akyasociados.com.ar>
To: sharvari N <sharvari_n@yahoo.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] a problem
Date: 27 Aug 2003 11:29:07 -0300
Message-ID: <1061994546.825.12.camel@taz.oficina> (raw)
In-Reply-To: <20030822090113.90339.qmail@web40107.mail.yahoo.com>
References: <20030822090113.90339.qmail@web40107.mail.yahoo.com>

if your table is named foo and the field you want to chage is bar, then:

BEGIN;
ALTER TABLE foo RENAME bar TO bar_old;
ALTER TABLE foo ADD bar VARCHAR(<new_size>);
UPDATE foo SET bar=bar_old;
*if everything went ok then*
ALTER TABLE foo DROP bar_old;
COMMIT;

same goes for CHAR data type.

about limitations:
http://www.postgresql.org/users-lounge/limitations.html

On Fri, 2003-08-22 at 06:01, sharvari N wrote:

> hello
> How do i change the definition of  a column? one of the columns width
> is not sufficient to store the data. I want to change the width. how
> to do that in postgres? I tried doing alter table + change/modify.
> both of them doesn't work in postgres.
>    and what is the maximum size to which a postgres database can grow?
> I have huge data to store. 
> regards
> sharvari
> 
> 
> ______________________________________________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (6+ messages)

Message-ID: <1061994546.825.12.camel@taz.oficina>
Permalink:  ../1061994546.825.12.camel@taz.oficina/
Also on:    postgresql.org/message-id/1061994546.825.12.camel@taz.oficina

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: franco@akyasociados.com.ar, sharvari_n@yahoo.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] a problem
  In-Reply-To: <1061994546.825.12.camel@taz.oficina>
  References: <20030822090113.90339.qmail@web40107.mail.yahoo.com> <1061994546.825.12.camel@taz.oficina>

* 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