Skip site navigation (1) Skip section navigation (2)

Re: BUG #6177: Size field type TEXT

From: Claudio Oliveira <claudiomsi(at)hotmail(dot)com>
To: <bruce(at)momjian(dot)us>, <kevin(dot)grittner(at)wicourts(dot)gov>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6177: Size field type TEXT
Date: 2011-08-25 18:29:24
Message-ID: BAY164-W1314A06E89E4C55BF068C7C1100@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello,

I'm doing the test in PGAdmin.

Must be a bug in PGAdmim.

I'm sorry I have not tested in psql

create table txt (val text);
txt insert into values ​​(repeat ('x', 4500));
char_length select (val) from txt;
txt insert into values ​​(repeat ('x', 4685));
char_length select (val) from txt;

select *, length (val) val is null, (val ~ 'x') from txt;

Thank you.
Claudio Oliveira 
http://www.msisolucoes.com.br

> From: bruce(at)momjian(dot)us
> Subject: Re: [BUGS] BUG #6177: Size field type TEXT
> To: Kevin(dot)Grittner(at)wicourts(dot)gov
> Date: Thu, 25 Aug 2011 13:20:22 -0400
> CC: claudiomsi(at)hotmail(dot)com; pgsql-bugs(at)postgresql(dot)org
> 
> Kevin Grittner wrote:
> > "Claudio Oliveira" <claudiomsi(at)hotmail(dot)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(at)momjian(dot)us>        http://momjian.us
>   EnterpriseDB                             http://enterprisedb.com
> 
>   + It's impossible for everything to be true. +
 		 	   		  

In response to

Responses

pgsql-bugs by date

Next:From: Noah HamersloughDate: 2011-08-25 19:05:34
Subject: BUG #6178: date_trunc : interval units "week" not supported contradicts documentation
Previous:From: Daniel FarinaDate: 2011-08-25 17:49:46
Subject: Re: BUG #6170: hot standby wedging on full-WAL disk

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group