summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev2008-01-15 17:16:01 +0000
committerTeodor Sigaev2008-01-15 17:16:01 +0000
commite8f63166cf91e2e5b2ebc9145f37621fd205a970 (patch)
tree168619b804a69b33e212a44a9b2244313d74606a
parent419e8f5df05709ee62079491964c0b29fe678a98 (diff)
Add check of headline method presence. Per report by Yoshiyuki Asaba <[email protected]>
-rw-r--r--src/backend/tsearch/wparser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/tsearch/wparser.c b/src/backend/tsearch/wparser.c
index f198a57fda..a6df603443 100644
--- a/src/backend/tsearch/wparser.c
+++ b/src/backend/tsearch/wparser.c
@@ -309,6 +309,11 @@ ts_headline_byid_opt(PG_FUNCTION_ARGS)
cfg = lookup_ts_config_cache(PG_GETARG_OID(0));
prsobj = lookup_ts_parser_cache(cfg->prsId);
+ if ( !OidIsValid( prsobj->headlineOid ) )
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Text parser doesn't support headline creation")));
+
memset(&prs, 0, sizeof(HeadlineParsedText));
prs.lenwords = 32;
prs.words = (HeadlineWordEntry *) palloc(sizeof(HeadlineWordEntry) * prs.lenwords);