Re: how to store more than 3 MB of character data in Postgres Varchar field

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vadivel Subramaniam <vadivel(dot)subramaniam(at)flextronicssoftware(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: how to store more than 3 MB of character data in Postgres Varchar field
Date: 2005-06-06 14:31:15
Message-ID: 25834.1118068275@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Vadivel Subramaniam <vadivel(dot)subramaniam(at)flextronicssoftware(dot)com> writes:
> 2. create table utilntmlscripts (name character varying, data character
> varying(10485770));
> ERROR: length for type 'varchar' cannot exceed 10485760
> It's not allowing more than 10 MB of size during table creation.

Use type "text", or equivalently varchar with no length specification.

The 1-MB limit on what you can write as a length spec is somewhat
arbitrary, but certainly an enforced length spec larger than that
would be a completely arbitrary number as well ...

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-06-06 14:44:49 Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
Previous Message Markus Bertheau ☭ 2005-06-06 14:17:24 Re: ARRAY() returning NULL instead of ARRAY[] resp. {}