aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2006-09-14 11:26:49 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2006-09-14 11:26:49 +0000
commitdeb66e013cfd858b15f1e507d11ed98c6e0088e5 (patch)
tree28c29032e0233868156ae8aeebd1e35c60cde77e
parent0ca9907ce443c58532f1c09e716b7d9cad9039a5 (diff)
downloadpostgresql-deb66e013cfd858b15f1e507d11ed98c6e0088e5.tar.gz
postgresql-deb66e013cfd858b15f1e507d11ed98c6e0088e5.zip
Improve error message. Per discussion
http://archives.postgresql.org/pgsql-general/2006-09/msg00186.php
-rw-r--r--src/backend/access/gin/ginscan.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/access/gin/ginscan.c b/src/backend/access/gin/ginscan.c
index c15181b9dbc..2093f1ce8a6 100644
--- a/src/backend/access/gin/ginscan.c
+++ b/src/backend/access/gin/ginscan.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.4 2006/08/03 15:22:09 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.5 2006/09/14 11:26:49 teodor Exp $
*-------------------------------------------------------------------------
*/
@@ -127,6 +127,11 @@ newScanKey( IndexScanDesc scan ) {
so->keys = (GinScanKey) palloc( scan->numberOfKeys * sizeof(GinScanKeyData) );
+ if (scan->numberOfKeys < 1)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("GIN indexes do not support whole-index scans")));
+
for(i=0; i<scan->numberOfKeys; i++) {
Datum* entryValues;
uint32 nEntryValues;
@@ -155,7 +160,9 @@ newScanKey( IndexScanDesc scan ) {
so->nkeys = nkeys;
if ( so->nkeys == 0 )
- elog(ERROR, "Gin doesn't support full scan due to it's awful inefficiency");
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("GIN index doesn't support search with void query")));
pgstat_count_index_scan(&scan->xs_pgstat_info);
}