Re: [HACKERS] Tuple size - Mailing list pgsql-hackers

From aixssd!darrenk@abs.net (Darren King)
Subject Re: [HACKERS] Tuple size
Date
Msg-id 331b22077b0cf4b6a242e7572331c8db
Whole thread Raw
In response to [HACKERS] Tuple size  (Alexander Demenshin <aldem@techie.com>)
List pgsql-hackers
> > From a friendly Alexander Dememshin:
> >
> > Hi!
> >
> >   I have tried:
> >
> > create table tab (v1 char(4096), v2 char(4096), v3 char(4096));
> >
> >   Then:
> >
> > insert into tab values('1');
> >
> >   OK
> >
> > insert into tab values('1','2');
> >
> >   Tuple is too big: size 8256.
> >
> >   Well, I understand why, but type 'char' is *fixed* length type,
> >   so even if I don't use some attributes, it *must* be inserted
> >   with all spaces... At least, I expected this... In this case
> >   I must get "tuple is too big" even if I will insert "empty"
> >   record. It is not so - why?
>
> Bruce Momjian wrote:
>
> NULL has zero length.

I think Alexander is questioning the fact that postgres let him make a table
with three fields totaling 12k in size when the max tuple size is at about
8000 bytes or so now.  Seems to me that "create table" code should check the
size of all attributes, at least when a size is given.  For "text" and any
other types that don't need a fixed size at create time, this understandably
can't be done, but for other sized types, IMHO, it should.


Darren  darrenk@insightdist.com

------------------------------

pgsql-hackers by date:

Previous
From: David Friend
Date:
Subject: Re: [HACKERS] Third Party Stuff
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] 6.1 jumbo patch?