[HACKERS] Tuple size

Поиск
Список
Период
Сортировка
От Alexander Demenshin
Тема [HACKERS] Tuple size
Дата
Msg-id 96d3e1691509ccdc10fedf6a27521abd
обсуждение исходный текст
Список pgsql-hackers
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?

  And one more: when I use 'varchar' without size, I get variable
  length attribute similar to 'text', which is stored with actual
  length, without padding. If I will specify length, it will be
  stored without padding, but will occupy specified number of bytes
  *always*, but, when retrieved, will return actual number of characters.
  Why not store only actual length, even if maximum specified?
  And, it will be listed as attribute with length zero, not 'var',
  but *actually* it is variable length, same as 'text'...

/Al

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

В списке pgsql-hackers по дате отправления: