Re: confused on maximum characters

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: <roypgsqlgen(at)xemaps(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: confused on maximum characters
Date: 2001-08-16 16:46:53
Message-ID: Pine.LNX.4.30.0108161844320.677-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

roypgsqlgen(at)xemaps(dot)com writes:

> Looking at the docs Peter Eisentraut added this note at the bottom of the documentation for character data.
> ---
> The maximum value for "n" is 2147483648. The longest possible string is actually only about 1 GB, though. The storage size of "(4+n)" is actually incorrect: char(n) really takes 4+n but varchar(n) and text take 4 plus the actual length of the stored string. Long strings will actually be compressed by the system, though.
> ---
>
> So does this mean I can specify very large varchar column types, like say varchar(1024)?

That's what that means. (Although qualifying 1024 as very large is a
little out of proportion given the actual limits.)

> And what does he mean by 'Long strings will actually be compressed by the system'?

The system will compress long strings, so they don't take as much space on
disk.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Wood 2001-08-16 17:01:44 Re: Roll Back dont roll back counters
Previous Message Tom Lane 2001-08-16 16:45:28 Re: why sequential scan