Re: index row size exceeds btree maximum

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: CSN <cool_screen_name90001(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: index row size exceeds btree maximum
Date: 2005-09-21 20:07:40
Message-ID: 1127333260.30825.65.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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));

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Sabino Mullane 2005-09-21 20:07:48 YAPC::Israel looking for Perl/Database speakers
Previous Message CSN 2005-09-21 20:02:34 index row size exceeds btree maximum