From bb0e3011f8670cefc7b4ef667d890c9adb7556db Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 28 Nov 2007 21:56:30 +0000 Subject: Make a cleanup pass over error reports in tsearch code. Use ereport for user-facing errors, fix some poor choices of errcode, adhere to message style guide. --- src/backend/utils/adt/tsvector_op.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/utils/adt/tsvector_op.c') diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index 87694236238..6ca1c898332 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/tsvector_op.c,v 1.9 2007/11/16 01:51:22 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/tsvector_op.c,v 1.10 2007/11/28 21:56:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -226,9 +226,9 @@ tsvector_setweight(PG_FUNCTION_ARGS) case 'd': w = 0; break; - /* internal error */ default: - elog(ERROR, "unrecognized weight"); + /* internal error */ + elog(ERROR, "unrecognized weight: %d", cw); } out = (TSVector) palloc(VARSIZE(in)); @@ -609,7 +609,7 @@ TS_execute(QueryItem *curitem, void *checkval, bool calcnot, return TS_execute(curitem + 1, checkval, calcnot, chkcond); default: - elog(ERROR, "unknown operator %d", curitem->operator.oper); + elog(ERROR, "unrecognized operator: %d", curitem->operator.oper); } /* not reachable, but keep compiler quiet */ -- cgit v1.2.3