pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Durgamahesh Manne <maheshpostgres9@gmail.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@lists.postgresql.org
Cc: andreas@a-kretschmer.de
Subject: Re: Regarding varchar max length in postgres
Date: Mon, 15 Oct 2018 11:40:31 +0200
Message-ID: <127747635e62a00d2abb7f25bea0c3a5aaaa2967.camel@cybertec.at> (raw)
In-Reply-To: <CAJCZkoJN-vAZLOU1XHxVjCfh1UYtJvup958wRph+upxP9wkj3w@mail.gmail.com>
References: <CAJCZkoLyv+0J0ACodg+mjL=VXFBMrMKZWWXkwMGgUFkOz8byBw@mail.gmail.com>
	<a9d74f73-12a4-9b06-3ab3-1ff0bfeab01b@aklaver.com>
	<CAJCZkoKaRr3uR+w0+W91N7zmv9XcVmTKjZ0hCMg61s7VxcvkdA@mail.gmail.com>
	<CAJCZkoKPAeT7G9B0oqJ7pH=PEyeeS6bviDmUyMsjgsAtKdDw+g@mail.gmail.com>
	<CAJCZkoKsYP6L91Rd3=8oxRh6K_GKZAFkmd1--PR4JWzqop_HSQ@mail.gmail.com>
	<CAJCZkoJN-vAZLOU1XHxVjCfh1UYtJvup958wRph+upxP9wkj3w@mail.gmail.com>

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





view thread (17+ messages)  latest in thread

Message-ID: <127747635e62a00d2abb7f25bea0c3a5aaaa2967.camel@cybertec.at>
Permalink:  ../127747635e62a00d2abb7f25bea0c3a5aaaa2967.camel@cybertec.at/
Also on:    postgresql.org/message-id/127747635e62a00d2abb7f25bea0c3a5aaaa2967.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, maheshpostgres9@gmail.com, adrian.klaver@aklaver.com, andreas@a-kretschmer.de
  Subject: Re: Regarding varchar max length in postgres
  In-Reply-To: <127747635e62a00d2abb7f25bea0c3a5aaaa2967.camel@cybertec.at>
  References: <CAJCZkoLyv+0J0ACodg+mjL=VXFBMrMKZWWXkwMGgUFkOz8byBw@mail.gmail.com> <a9d74f73-12a4-9b06-3ab3-1ff0bfeab01b@aklaver.com> <CAJCZkoKaRr3uR+w0+W91N7zmv9XcVmTKjZ0hCMg61s7VxcvkdA@mail.gmail.com> <CAJCZkoKPAeT7G9B0oqJ7pH=PEyeeS6bviDmUyMsjgsAtKdDw+g@mail.gmail.com> <CAJCZkoKsYP6L91Rd3=8oxRh6K_GKZAFkmd1--PR4JWzqop_HSQ@mail.gmail.com> <CAJCZkoJN-vAZLOU1XHxVjCfh1UYtJvup958wRph+upxP9wkj3w@mail.gmail.com> <127747635e62a00d2abb7f25bea0c3a5aaaa2967.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox