aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/tsvector.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-10-21 22:29:56 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-10-21 22:29:56 +0000
commit1ea47dd8cbcb485a06676f12a36244270e18e192 (patch)
treeafcd226d47815acf89a4a62442ecdd1467594edb /src/backend/utils/adt/tsvector.c
parentdfc6f130b4fe64cbaff379eb1a2a97f6e050eb3e (diff)
downloadpostgresql-1ea47dd8cbcb485a06676f12a36244270e18e192.tar.gz
postgresql-1ea47dd8cbcb485a06676f12a36244270e18e192.zip
Fix shared tsvector/tsquery input code so that we don't say "syntax error in
tsvector" when we are really parsing a tsquery. Report the bogus input, too. Make styles of some related error messages more consistent.
Diffstat (limited to 'src/backend/utils/adt/tsvector.c')
-rw-r--r--src/backend/utils/adt/tsvector.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/utils/adt/tsvector.c b/src/backend/utils/adt/tsvector.c
index 992da4a9b40..0d82da1f902 100644
--- a/src/backend/utils/adt/tsvector.c
+++ b/src/backend/utils/adt/tsvector.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.4 2007/09/07 16:03:40 teodor Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.5 2007/10/21 22:29:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -204,7 +204,7 @@ tsvectorin(PG_FUNCTION_ARGS)
pg_verifymbstr(buf, strlen(buf), false);
- state = init_tsvector_parser(buf, false);
+ state = init_tsvector_parser(buf, false, false);
arrlen = 64;
arr = (WordEntryIN *) palloc(sizeof(WordEntryIN) * arrlen);
@@ -224,7 +224,7 @@ tsvectorin(PG_FUNCTION_ARGS)
if (cur - tmpbuf > MAXSTRPOS)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("position value too large")));
+ errmsg("position value is too large")));
/*
* Enlarge buffers if needed
@@ -496,7 +496,7 @@ tsvectorrecv(PG_FUNCTION_ARGS)
datalen += lex_len;
if (i > 0 && WordEntryCMP(&vec->entries[i], &vec->entries[i - 1], STRPTR(vec)) <= 0)
- elog(ERROR, "lexemes are unordered");
+ elog(ERROR, "lexemes are misordered");
/* Receive positions */
@@ -523,7 +523,7 @@ tsvectorrecv(PG_FUNCTION_ARGS)
{
wepptr[j] = (WordEntryPos) pq_getmsgint(buf, sizeof(WordEntryPos));
if (j > 0 && WEP_GETPOS(wepptr[j]) <= WEP_GETPOS(wepptr[j - 1]))
- elog(ERROR, "position information is unordered");
+ elog(ERROR, "position information is misordered");
}
datalen += (npos + 1) * sizeof(WordEntry);