Re: alter table type from double precision to real

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: ssoo(at)siliconfile(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: alter table type from double precision to real
Date: 2007-06-25 04:35:11
Message-ID: 12671.1182746111@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Fuhr <mike(at)fuhr(dot)org> writes:
> On Mon, Jun 25, 2007 at 09:51:30AM +0900, ssoo(at)siliconfile(dot)com wrote:
>> 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.

Even with no other columns involved, if you're on a machine with
MAXALIGN = 8 (which includes all 64-bit platforms as well as some
that aren't), the row width won't shrink.

As for that pg_dump measurement, the text form isn't going to get
smaller ... "1.2" is the same length as "1.2".

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Murali Doss 2007-06-25 06:22:57 postgresql varchar[] data type equivalent in Oracle
Previous Message Michael Fuhr 2007-06-25 04:16:10 Re: alter table type from double precision to real