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

From darrenk@insightdist.com (Darren King)
Subject Re: [HACKERS] varchar size
Date
Msg-id 9801081631.AA89094@ceodev
Whole thread Raw
List pgsql-hackers
> I have applied the following patch to allow varchar() fields to store
> just the needed bytes, and not the maximum size.
>
> ...
>
> And if I create a varchar(2000), it does not take several 8k blocks to
> store 10 rows, like it did before.

Fixes the following "problem" too...

Currently, you can create a table with attributes that _can_ total more
than the max_tup_size if they maximum size, but not be able to insert
valid data into all of them.

For instance, ...

create table foo (bar varchar(4000),
                  bah varchar(3000),
                  baz varchar(2000));

... is fine as long as one of the attributes is null.  Now you can have
non-null values for all three as long as they don't go over max_tup_size
in _total_.

darrenk


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Did the patch get recieved?
Next
From: darrenk@insightdist.com (Darren King)
Date:
Subject: Disk block size issues.