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

From: Klint Gore <kgore4(at)une(dot)edu(dot)au>
To: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: copy ... from stdin csv; and bytea
Date: 2008-07-28 06:10:44
Message-ID: 488D62E4.1040008@une.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Wilson wrote:
> On Mon, Jul 28, 2008 at 1:24 AM, Klint Gore <kgore4(at)une(dot)edu(dot)au> wrote:
> > Try just a single \
> >
> > e.g.
> > "ge.xls","application/vnd.ms-excel",71168,"\320\317\021\340\241[snip]
>
> Thanks- I did try that, and it at least gave the expected output from
> select, but is there a way to verify that it's actually handling it
> correctly rather than simply storing the sequence of characters? I'm
> not certain how to check the actual byte width of a column within a
> row, and I'd *really* rather not be storing 4 bytes for every 1 in the
> binary if I can avoid it- this column is already going to be doubling
> field width; quadrupling it would give me space headaches I really
> don't want to deal with. :)
>
>
select length(bytea_field) from table

You could use ||pg_relation_size|(|text|)| or
||pg_total_relation_size|(|text|) |to see how much disk space it takes up.

You can play with the storage settings for the column if you want to try
and handle the space better. see alter table set storage.

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-07-28 06:51:02 Re: copy ... from stdin csv; and bytea
Previous Message David Wilson 2008-07-28 05:39:56 Re: copy ... from stdin csv; and bytea