Re: Regarding varchar max length in postgres - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Regarding varchar max length in postgres
Date
Msg-id 127747635e62a00d2abb7f25bea0c3a5aaaa2967.camel@cybertec.at
Whole thread Raw
In response to Re: Regarding varchar max length in postgres  (Durgamahesh Manne <maheshpostgres9@gmail.com>)
List pgsql-general
Durgamahesh Manne wrote:
> was there any specific reason that you have given max length for varchar is limited to 10485760 value?
> 
> why you have not given max length for varchar is unlimited like text datatype ?
> 
> character varying(n), varchar(n)variable-length with limit 
> character(n), char(n)fixed-length, blank padded
> textvariable unlimited length

The data type "text" has the same size limit of 1GB.
"character varying" (without type modifier) and "text" are pretty much
identical.

Since data of these types are loaded into memory when you read them
from or write them to the database, you usually start having problems
long before you reach that limit.

If you want to store huge text files, either store them outside the
database or use Large Objects, which can be read and written in chunks.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



pgsql-general by date:

Previous
From: Arthur Zakirov
Date:
Subject: Re: Enabling autovacuum per table
Next
From: Thomas Kellerer
Date:
Subject: Re: Regarding varchar max length in postgres