|
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.4 2006/08/03 15:22:09 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.5 2006/09/14 11:26:49 teodor Exp $ |
12 | 12 | *------------------------------------------------------------------------- |
13 | 13 | */ |
14 | 14 |
|
@@ -127,6 +127,11 @@ newScanKey( IndexScanDesc scan ) { |
127 | 127 |
|
128 | 128 | so->keys= (GinScanKey)palloc(scan->numberOfKeys*sizeof(GinScanKeyData) ); |
129 | 129 |
|
| 130 | +if (scan->numberOfKeys<1) |
| 131 | +ereport(ERROR, |
| 132 | +(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), |
| 133 | +errmsg("GIN indexes do not support whole-index scans"))); |
| 134 | + |
130 | 135 | for(i=0;i<scan->numberOfKeys;i++) { |
131 | 136 | Datum*entryValues; |
132 | 137 | uint32nEntryValues; |
@@ -155,7 +160,9 @@ newScanKey( IndexScanDesc scan ) { |
155 | 160 | so->nkeys=nkeys; |
156 | 161 |
|
157 | 162 | if (so->nkeys==0 ) |
158 | | -elog(ERROR,"Gin doesn't support full scan due to it's awful inefficiency"); |
| 163 | +ereport(ERROR, |
| 164 | +(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), |
| 165 | +errmsg("GIN index doesn't support search with void query"))); |
159 | 166 |
|
160 | 167 | pgstat_count_index_scan(&scan->xs_pgstat_info); |
161 | 168 | } |
|