From cceed24e1f7c46d1f73837780544fe2fefa2962f Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Sat, 12 Sep 2015 15:16:25 +0200 Subject: [PATCH] Check max # of col in an hypothetical index --- hypopg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hypopg.c b/hypopg.c index b84e8b8..95678a9 100644 --- a/hypopg.c +++ b/hypopg.c @@ -494,6 +494,10 @@ hypo_entry_store_parsetree(IndexStmt *node, const char *queryString) ncolumns = list_length(node->indexParams); + if (ncolumns > INDEX_MAX_KEYS) + elog(ERROR, "hypopg: cannot use more thant %d columns in an index", + INDEX_MAX_KEYS); + initStringInfo(&indexRelationName); appendStringInfo(&indexRelationName, "%s", node->accessMethod); appendStringInfo(&indexRelationName, "_");