Re: Column Sizes

From: "Brett Maton" <brett(dot)maton(at)itaccounting(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Column Sizes
Date: 2003-11-13 09:47:08
Message-ID: bovjt4$jg0$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for the answers guys,

I ran a quick query lastnight select length(data) from pg_largeobject
where loid = xxxx which prompted my post.

The query returned 'n' rows of 2048 bytes and an incomplete "page" of say
236, as I wasn't really thinking about it that much I assumed for some
reason that the data column was limited to a maximum of 2048 bytes by the
database. I was hoping to select this value (2048) from a query
(like \d tablename describes the columns and sizes) to build a buffer
either a) large enough or b) sensibly proportioned.

Although my question may not be relevant to this particular issue there
are times that I would like to now the size of a particular column, and I
believe
that it's possible to get this value from the database using a query and
pg_catalog etc, just not sure how to achieve this.

Thanks again,

Brett

"Brett Maton" <brett(dot)maton(at)itaccounting(dot)co(dot)uk> wrote in message
news:botsl3$tsp$1(at)news(dot)hub(dot)org(dot)(dot)(dot)
> 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.
>
> Any help would be appreciated.
>
> Thanks in advance,
>
> Brett
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2003-11-13 11:13:19 Re: RHEL
Previous Message Richard Huxton 2003-11-13 09:34:27 Re: RHEL