Thread: index row size exceeds btree maximum

index row size exceeds btree maximum

From
CSN
Date:
This appears related to my previous post:
http://archives.postgresql.org/pgsql-general/2005-09/msg00809.php

I setup a unique index using the title, yield, and
directions fields. Some inserts are causing this
error:

DBD::Pg::st execute failed: ERROR:  index row size
2832 exceeds btree maximum, 2713
CONTEXT:  SQL statement "insert into stuff (title,
yield, directions) values ( $1 ,  $2 ,  $3 )"

What do I do?

Thanks,
CSN



__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

Re: index row size exceeds btree maximum

From
Scott Marlowe
Date:
On Wed, 2005-09-21 at 15:02, CSN wrote:
> This appears related to my previous post:
> http://archives.postgresql.org/pgsql-general/2005-09/msg00809.php
>
> I setup a unique index using the title, yield, and
> directions fields. Some inserts are causing this
> error:
>
> DBD::Pg::st execute failed: ERROR:  index row size
> 2832 exceeds btree maximum, 2713
> CONTEXT:  SQL statement "insert into stuff (title,
> yield, directions) values ( $1 ,  $2 ,  $3 )"
>
> What do I do?

Don't insert such big values?  :)

Actually, the standard solution is to use an md5 of the three fields:

create unique index threefieldindex on table1
(md5(field1||field2||field3));

Re: index row size exceeds btree maximum

From
CSN
Date:

--- Scott Marlowe <smarlowe@g2switchworks.com> wrote:

> On Wed, 2005-09-21 at 15:02, CSN wrote:
> > This appears related to my previous post:
> >
>
http://archives.postgresql.org/pgsql-general/2005-09/msg00809.php
> >
> > I setup a unique index using the title, yield, and
> > directions fields. Some inserts are causing this
> > error:
> >
> > DBD::Pg::st execute failed: ERROR:  index row size
> > 2832 exceeds btree maximum, 2713
> > CONTEXT:  SQL statement "insert into stuff (title,
> > yield, directions) values ( $1 ,  $2 ,  $3 )"
> >
> > What do I do?
>
> Don't insert such big values?  :)
>
> Actually, the standard solution is to use an md5 of
> the three fields:
>
> create unique index threefieldindex on table1
> (md5(field1||field2||field3));
>

Ah, cool! Looks like using tsearch2 would be another
option, but I don't plan on searching through the
yield or directions fields (except at insert time).


http://joseph.randomnetworks.com/archives/2005/08/05/postgresql-index-limitation-index-row-size-xxxxx-exceeds-btree-maximum-2713/

CSN


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com