Re: Column Sizes - Mailing list pgsql-general

From Doug McNaught
Subject Re: Column Sizes
Date
Msg-id 87islpwcgu.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to Column Sizes  ("Brett Maton" <brett.maton@itaccounting.co.uk>)
List pgsql-general
"Brett Maton" <brett.maton@itaccounting.co.uk> writes:

> Hi NG,
>
>   How do I find out the size of a column ?
>
>   I am retrieving large objects from the pg_largeobject table and creating a
> files, I would like to know the length of the data column so that I can
> implement buffering instead of writing hundreds of small chunks to disk.

Funny, there doesn't seem to be an lo_size() function--I was sure
there was one.  I'm not sure if there's a way to find out the size of
a large object without reading it all.

If you just do lo_read() in a loop with a reasonably large buffer it
should be fairly efficient.

-Doug

pgsql-general by date:

Previous
From: Scott Chapman
Date:
Subject: Re: SQL-question: returning the id of an insert querry
Next
From: Doug McNaught
Date:
Subject: Re: pl/perl function life and variable scope - concurrency problem?