Monday, July 28, 2008

Re: [GENERAL] copy ... from stdin csv; and bytea

Tom Lane wrote:
> Klint Gore <kgore4@une.edu.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@une.edu.au


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

No comments: