Re: index row size 2728 exceeds btree maximum, 2713

Lists: pgsql-generalpgsql-sql
From: "Dinesh Pandey" <dpandey(at)secf(dot)com>
To: "'Richard Huxton'" <dev(at)archonet(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>, "'PostgreSQL'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: index row size 2728 exceeds btree maximum, 2713
Date: 2004-01-01 10:09:06
Message-ID: 20050602101340.9FCC75280A@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

I am inserting some log messages in the column "data". (Basically I am
inserting records from reading an xml file)

In the PRIMARY KEY, btree (scan_id, host_ip, port_num, plugin_id, severity,
data) data is of type TEXT and can contain long string values.

The question is how to remove this error "index row size 2728 exceeds btree
maximum, 2713" by increasing the btree size?

The big problem is "I can not add any additional column in this table."

Thanks
Dinesh Pandey

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Richard Huxton
Sent: Thursday, June 02, 2005 3:29 PM
To: dpandey(at)secf(dot)com
Cc: pgsql-general(at)postgresql(dot)org; 'PostgreSQL'
Subject: Re: [GENERAL] index row size 2728 exceeds btree maximum, 2713

Dinesh Pandey wrote:
> -----------+-----------------------+-----------
> Column | Type
> -----------+-----------------------+-----------
> scan_id | bigint
> host_ip | character varying(15)
> port_num | integer
> plugin_id | integer
> severity | character varying(50)
> data | text
>
> Indexes:
> "pk_scanned_port_info" PRIMARY KEY, btree (scan_id, host_ip, port_num,
> plugin_id, severity, data)
>
> On inserting record I am getting this error "index row size 2728 exceeds
> btree maximum, 2713"

Well - the error message is clear enough. The question is, what to do.

Without knowing what the table "means", it's difficult to say what the
primary-key should be, but it seems unlikely to include an
unlimited-length text-field called "data".

If the data itself doesn't offer any suitable candidate keys (as can
well be the case) then common practice is to generate a unique number
and use that as an ID - in PostgreSQL's case by use of the SERIAL
pseudo-type.

Does that help?
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


From: "Dinesh Pandey" <dpandey(at)secf(dot)com>
To: <pgsql-general(at)postgresql(dot)org>, "'PostgreSQL'" <pgsql-sql(at)postgresql(dot)org>
Subject: index row size 2728 exceeds btree maximum, 2713
Date: 2005-06-02 07:04:58
Message-ID: 20050602071021.512DC5286E@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

TABLE

-----------+-----------------------+-----------

Column | Type

-----------+-----------------------+-----------

scan_id | bigint

host_ip | character varying(15)

port_num | integer

plugin_id | integer

severity | character varying(50)

data | text

Indexes:

"pk_scanned_port_info" PRIMARY KEY, btree (scan_id, host_ip, port_num,
plugin_id, severity, data)

On inserting record I am getting this error "index row size 2728 exceeds
btree maximum, 2713"

How to solve this problem?


From: Richard Huxton <dev(at)archonet(dot)com>
To: dpandey(at)secf(dot)com
Cc: pgsql-general(at)postgresql(dot)org, 'PostgreSQL' <pgsql-sql(at)postgresql(dot)org>
Subject: Re: index row size 2728 exceeds btree maximum, 2713
Date: 2005-06-02 09:58:49
Message-ID: 429ED859.1070308@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

Dinesh Pandey wrote:
> -----------+-----------------------+-----------
> Column | Type
> -----------+-----------------------+-----------
> scan_id | bigint
> host_ip | character varying(15)
> port_num | integer
> plugin_id | integer
> severity | character varying(50)
> data | text
>
> Indexes:
> "pk_scanned_port_info" PRIMARY KEY, btree (scan_id, host_ip, port_num,
> plugin_id, severity, data)
>
> On inserting record I am getting this error "index row size 2728 exceeds
> btree maximum, 2713"

Well - the error message is clear enough. The question is, what to do.

Without knowing what the table "means", it's difficult to say what the
primary-key should be, but it seems unlikely to include an
unlimited-length text-field called "data".

If the data itself doesn't offer any suitable candidate keys (as can
well be the case) then common practice is to generate a unique number
and use that as an ID - in PostgreSQL's case by use of the SERIAL
pseudo-type.

Does that help?
--
Richard Huxton
Archonet Ltd


From: Richard Huxton <dev(at)archonet(dot)com>
To: dpandey(at)secf(dot)com
Cc: pgsql-general(at)postgresql(dot)org, 'PostgreSQL' <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] index row size 2728 exceeds btree maximum, 2713
Date: 2005-06-02 10:43:45
Message-ID: 429EE2E1.30904@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

Dinesh Pandey wrote:
> I am inserting some log messages in the column "data". (Basically I am
> inserting records from reading an xml file)
>
> In the PRIMARY KEY, btree (scan_id, host_ip, port_num, plugin_id, severity,
> data) data is of type TEXT and can contain long string values.

I'm still not convinced that "data" makes a sensible part of the primary
key. Can you give an example of "data" and explain why the whole value
determines unique-ness?

> The question is how to remove this error "index row size 2728 exceeds btree
> maximum, 2713" by increasing the btree size?
>
> The big problem is "I can not add any additional column in this table."

Why not?

--
Richard Huxton
Archonet Ltd