1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

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.
This commit is contained in:
Tom Lane
2007-11-28 21:56:30 +00:00
parent 664782ee74
commit bb0e3011f8
9 changed files with 71 additions and 47 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.9 2007/11/16 15:05:59 teodor Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.10 2007/11/28 21:56:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -480,13 +480,13 @@ tsvectorrecv(PG_FUNCTION_ARGS)
lex_len = strlen(lexeme);
if (lex_len < 0 || lex_len > MAXSTRLEN)
elog(ERROR, "invalid tsvector; lexeme too long");
elog(ERROR, "invalid tsvector: lexeme too long");
if (datalen > MAXSTRPOS)
elog(ERROR, "invalid tsvector; maximum total lexeme length exceeded");
elog(ERROR, "invalid tsvector: maximum total lexeme length exceeded");
if (npos > MAXNUMPOS)
elog(ERROR, "unexpected number of positions");
elog(ERROR, "unexpected number of tsvector positions");
/*
* Looks valid. Fill the WordEntry struct, and copy lexeme.