From: Bruce Momjian <bruce@momjian.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Claudio Oliveira <claudiomsi@hotmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6177: Size field type TEXT
Date: Thu, 25 Aug 2011 13:20:22 -0400 (EDT)
Message-ID: <201108251720.p7PHKMC23157@momjian.us> (raw)
In-Reply-To: <4E563CA402000025000406D7@gw.wicourts.gov>
Kevin Grittner wrote:
> "Claudio Oliveira" <claudiomsi@hotmail.com> wrote:
>
> > Use version 8.4 and have no issues with the field type TEXT.
> >
> > In version 9.1rc1 is limited to 4680 characters.
> >
> > Where do I change that size?
>
> test=# create table txt (val text);
> CREATE TABLE
> test=# insert into txt values (repeat('long string', 1000000));
> INSERT 0 1
> test=# select char_length(val) from txt;
> char_length
> -------------
> 11000000
> (1 row)
>
> What makes you think it's limited to 4680 characters?
My guess is there is an index on the column:
test=> create table txt (val text);
CREATE TABLE
test=> create index i_txt on txt(val);
CREATE INDEX
test=> insert into txt values (repeat('long string', 1000000));
ERROR: index row requires 125944 bytes, maximum size is 8191
You should probably not index long columns but rather index an md5 hash
of the value.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
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-bugs@postgresql.org
Cc: bruce@momjian.us, Kevin.Grittner@wicourts.gov, claudiomsi@hotmail.com
Subject: Re: BUG #6177: Size field type TEXT
In-Reply-To: <201108251720.p7PHKMC23157@momjian.us>
References: <4E563CA402000025000406D7@gw.wicourts.gov> <201108251720.p7PHKMC23157@momjian.us>
* 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