Re: alter table type from double precision to real

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: ssoo(at)siliconfile(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: alter table type from double precision to real
Date: 2007-06-25 04:16:10
Message-ID: 20070625041610.GA38794@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 25, 2007 at 09:51:30AM +0900, ssoo(at)siliconfile(dot)com wrote:
> Real type takes 4 byte storage sizes and double precision takes 8 bytes.
> I altered a data type from double precision to real and vacuumed DB.

Altering a column's type rewrites the table so vacuuming afterward
shouldn't be necessary.

> But PostgreSQL's data disk usage did not shrinked.
> And pg_dump size remained same.
> It seems that real takes 8 byte storage sizes.

Real is 4 bytes but other columns' alignment requirements might
result in no space being saved.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-06-25 04:35:11 Re: alter table type from double precision to real
Previous Message ssoo 2007-06-25 00:51:30 alter table type from double precision to real