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

From Bruce Momjian
Subject Re: [HACKERS] Tuple size
Date
Msg-id 0185e413e95946d9ee66e94a10e225f3
Whole thread Raw
In response to [HACKERS] Tuple size  (Alexander Demenshin <aldem@techie.com>)
List pgsql-hackers
>
> On Fri, Jun 20, 1997 at 02:31:02PM -0400, Bruce Momjian wrote:
>
> > Now I am confused.  Does varchar() store only used bytes?  Then the FAQ
> > is wrong.  It says char() and varchar() always store maximum length.
>
>   varchar() stores maximum length only (and only!) if length is
>   specified. varchar(100) will always store 100 bytes, while
>   varchar will store only entered bytes:
>
> create table tab (v varchar);
>
>   This will work as text. But:
>
> create table tab (v varchar(100));
>
>   will *always* store 100 characters. The only difference from
>   char() - varchar() is not padded with spaces...

I feel better now.

- --
Bruce Momjian
maillist@candle.pha.pa.us

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

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Tuple size
Next
From: Andrew Martin
Date:
Subject: [HACKERS] Patch to psql.c to allow .psqlrc file