Re: alter table type from double precision to real

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: ssoo(at)siliconfile(dot)com, Michael Fuhr <mike(at)fuhr(dot)org>
Subject: Re: alter table type from double precision to real
Date: 2007-06-25 12:23:49
Message-ID: 200706250823.49609.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 25 June 2007 03:35, ssoo(at)siliconfile(dot)com wrote:
> Michael Fuhr <mike(at)fuhr(dot)org> wrote:
> > Altering a column's type rewrites the table so vacuuming afterward
> > shouldn't be necessary.
>
> I'm gonna alter another table type from double precision to real.
> This table size is lager than disk free space.
> Can it be possible?
> Previsouly, I saw continuous increasing in disk usage until
> alter complete.
> I'm afraid of disk full and aftereffects.

Correct, modifying table data types requires a table re-write, so you're
likely to run out of space. You're not too likely to have much trouble by
trying, when you run out of disk space the transaction will roll back and you
should be ok. One method to try and get around this might be to drop and
then recreate relevant indexes (thereby freeing up space ahead of time)
though you'll need to commit between those commands. HTH

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2007-06-25 12:30:29 Re: Experiences of PostgreSQL on-disk bitmap index patch
Previous Message Gregory Stark 2007-06-25 11:50:28 Re: alter table type from double precision to real