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

From aixssd!darrenk@abs.net (Darren King)
Subject Re: [HACKERS] Tuple size
Date
Msg-id a296e92d0672bee6f206055ecb235e7a
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: "Vadim B. Mikheev"
Date:
Subject: Re: [HACKERS] Useful addition for psql?
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Tuple size