Re: [HACKERS] Tuple size

Поиск
Список
Период
Сортировка
От aixssd!darrenk@abs.net (Darren King)
Тема Re: [HACKERS] Tuple size
Дата
Msg-id a296e92d0672bee6f206055ecb235e7a
обсуждение исходный текст
Ответ на [HACKERS] Tuple size  (Alexander Demenshin <aldem@techie.com>)
Список 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 по дате отправления: