Skip to content

Commit deb66e0

Browse files
committed
1 parent 0ca9907 commit deb66e0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/backend/access/gin/ginscan.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* 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 $
1212
*-------------------------------------------------------------------------
1313
*/
1414

@@ -127,6 +127,11 @@ newScanKey( IndexScanDesc scan ) {
127127

128128
so->keys = (GinScanKey) palloc( scan->numberOfKeys * sizeof(GinScanKeyData) );
129129

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+
130135
for(i=0; i<scan->numberOfKeys; i++) {
131136
Datum* entryValues;
132137
uint32 nEntryValues;
@@ -155,7 +160,9 @@ newScanKey( IndexScanDesc scan ) {
155160
so->nkeys = nkeys;
156161

157162
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")));
159166

160167
pgstat_count_index_scan(&scan->xs_pgstat_info);
161168
}

0 commit comments

Comments
 (0)