Re: [HACKERS] Tuple size
| От | Bruce Momjian |
|---|---|
| Тема | Re: [HACKERS] Tuple size |
| Дата | |
| Msg-id | 04b4b309c476adddbdd89374069c3163 обсуждение исходный текст |
| Ответ на | [HACKERS] Tuple size (Alexander Demenshin <aldem@techie.com>) |
| Список | pgsql-hackers |
> > On Fri, Jun 20, 1997 at 01:36:31PM -0400, Bruce Momjian wrote: > > > > I know, this, of course. But varchar without length does same > > > thing. So, why we need text and varchar to co-exist? > > > > text always stores allocated bytes, text only stores used bytes. > > ??? > > Try this: > > create table tab (t text, v varchar); > > Then make some inserts with different length, and you will see, > both 't' and 'v' stores used bytes *only*... > > So, again my question - why we need two different types with > identical behavior? I can use varchar for indexes, but I can use > text for this purpose too... Where is the difference? > > And, why length of varchar() is limited to 4096, not, eg. 6144? Now I am confused. Does varchar() store only used bytes? Then the FAQ is wrong. It says char() and varchar() always store maximum length. The answer to your question of why they both exist is that postgres initially had only text, and char() and varchar() were added for SQL compatability. - -- Bruce Momjian maillist@candle.pha.pa.us ------------------------------
В списке pgsql-hackers по дате отправления: