Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4F3EAB5DBF7 for ; Thu, 25 Aug 2011 14:20:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 92145-02 for ; Thu, 25 Aug 2011 17:20:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id A4761B5DBBF for ; Thu, 25 Aug 2011 14:20:24 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p7PHKMC23157; Thu, 25 Aug 2011 13:20:22 -0400 (EDT) From: Bruce Momjian Message-Id: <201108251720.p7PHKMC23157@momjian.us> Subject: Re: BUG #6177: Size field type TEXT In-Reply-To: <4E563CA402000025000406D7@gw.wicourts.gov> To: Kevin Grittner Date: Thu, 25 Aug 2011 13:20:22 -0400 (EDT) CC: Claudio Oliveira , pgsql-bugs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.432 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.532 X-Spam-Level: X-Archive-Number: 201108/153 X-Sequence-Number: 30965 Kevin Grittner wrote: > "Claudio Oliveira" 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 http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +