Re: alter table type from double precision to real

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

Actually, table size shrinked a little.
But I misinterpreted it as no shrinking.
I expected much more shrinking.

Thank you for your concerns.

Michael Fuhr <mike(at)fuhr(dot)org> wrote:
> I see table sizes shrink on 64-bit sparc and x86 architectures, as
> in the following example that results in adjacent 4-byte columns.
> Or am I misinterpreting what's happening?
>
> test=> create table test (col1 double precision, col2 integer);
> CREATE TABLE
> test=> insert into test select 1.0, 1 from generate_series(1, 10000);
> INSERT 0 10000
> test=> select pg_relation_size('test');
> pg_relation_size
> ------------------
> 524288
> (1 row)
>
> test=> alter table test alter col1 type real;
> ALTER TABLE
> test=> select pg_relation_size('test');
> pg_relation_size
> ------------------
> 450560
> (1 row)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ssoo 2007-06-25 07:35:52 Re: alter table type from double precision to real
Previous Message Michael Fuhr 2007-06-25 07:07:01 Re: alter table type from double precision to real