Re: copy ... from stdin csv; and bytea

From: Klint Gore <kgore4(at)une(dot)edu(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>, pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: copy ... from stdin csv; and bytea
Date: 2008-07-28 07:28:02
Message-ID: 488D7502.8010707@une.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Klint Gore <kgore4(at)une(dot)edu(dot)au> writes:
> > David Wilson wrote:
> >> I'm not certain how to check the actual byte width of a column within a
> >> row,
>
> > select length(bytea_field) from table
>
> If you want the actual on-disk footprint, use pg_column_size()
>
>
Size on disk would have the compression from the default storage =
extended wouldn't it?

I verified it for myself manually anyway.

copy (select * from original limit 5) to stdout with csv;

create table foo (like original);
alter table foo alter column bytea_field set storage external;
copy foo from stdin with csv;

select |reltoastrelid from pg_class where relanem = 'original'

found the file for it and looked at it with a hex viewer.
|
klint.

--
Klint Gore
Database Manager
Sheep CRC
A.G.B.U.
University of New England
Armidale NSW 2350

Ph: 02 6773 3789
Fax: 02 6773 3266
EMail: kgore4(at)une(dot)edu(dot)au

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-07-28 08:32:39 Re: why my postgresql auto crashed???
Previous Message Yi Zhao 2008-07-28 07:02:47 why my postgresql auto crashed???