1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-13 16:22:44 +03:00

Add hints to cases where indexes fail because of values that are too long.

This commit is contained in:
Bruce Momjian
2005-08-10 21:36:46 +00:00
parent 8bbf227ad7
commit 237be3cc29
4 changed files with 16 additions and 8 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.121 2005/06/06 20:22:57 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.122 2005/08/10 21:36:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -392,7 +392,10 @@ _bt_insertonpg(Relation rel,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("index row size %lu exceeds btree maximum, %lu",
(unsigned long) itemsz,
(unsigned long) BTMaxItemSize(page))));
(unsigned long) BTMaxItemSize(page)),
errhint("Values larger than 1/3 of a buffer page cannot be indexed\n"
"Consider a separate column containing an MD5 hash of the value\n"
"or use full text indexing.")));
/*
* Determine exactly where new item will go.

View File

@@ -56,7 +56,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.91 2005/06/06 20:22:57 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.92 2005/08/10 21:36:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -498,7 +498,10 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, BTItem bti)
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("index row size %lu exceeds btree maximum, %lu",
(unsigned long) btisz,
(unsigned long) BTMaxItemSize(npage))));
(unsigned long) BTMaxItemSize(npage)),
errhint("Values larger than 1/3 of a buffer page cannot be indexed\n"
"Consider a separate column containing an MD5 hash of the value\n"
"or use full text indexing.")));
if (pgspc < btisz || pgspc < state->btps_full)
{