Maximum len of data fit into the tuple

From: Denis Perchine <dyp(at)perchine(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Maximum len of data fit into the tuple
Date: 2000-06-25 20:48:40
Message-ID: 0006260353560M.00485@dyp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello all,

I try to write large objects in one table support for postgres and have
following problem:

I should calculate maximum amount of data I can put into the bytea field.
Table scheme is:

create table pg_largeobject {
loid oid,
lastbyte int4,
data bytea
);

If I will assume that oid == int4 I will have 4 * 2 + 4 (size of vl_len in bytea) = 12.
Plus 36 bytes of header (as noted in FAQ). It will be 48 bytes... But I still get
error that tuple is out too big... And that my size is 8188, but should be 8140.

It would be great if someone will clarify the way I should do such calculations.

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp(at)perchine(dot)com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ryan Kirkpatrick 2000-06-25 22:08:55 Re: [HACKERS] Re: Call for port testing on fmgr changes -- Results!
Previous Message Thomas Lockhart 2000-06-25 16:40:27 Re: SQL_TEXT (Re: Re: Big 7.1 open items)