ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("bad cube representation"),
- errdetail("different point dimensions in (%s) and (%s)",
+ errdetail("Different point dimensions in (%s) and (%s).",
$2, $4)));
YYABORT;
}
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("bad cube representation"),
- errdetail("more than %d dimensions",
- CUBE_MAX_DIM)));
+ errdetail("A cube cannot have more than %d dimensions.",
+ CUBE_MAX_DIM)));
YYABORT;
}
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("bad cube representation"),
- errdetail("different point dimensions in (%s) and (%s)",
+ errdetail("Different point dimensions in (%s) and (%s).",
$1, $3)));
YYABORT;
}
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("bad cube representation"),
- errdetail("more than %d dimensions",
+ errdetail("A cube cannot have more than %d dimensions.",
CUBE_MAX_DIM)));
YYABORT;
}
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("bad cube representation"),
- errdetail("more than %d dimensions",
+ errdetail("A cube cannot have more than %d dimensions.",
CUBE_MAX_DIM)));
YYABORT;
}
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("bad cube representation"),
- errdetail("more than %d dimensions",
+ errdetail("A cube cannot have more than %d dimensions.",
CUBE_MAX_DIM)));
YYABORT;
}
}
-static NDBOX * write_point_as_box(char *str, int dim)
+static NDBOX *
+write_point_as_box(char *str, int dim)
{
NDBOX * bp;
int i, size;
PREPAREARR(r);
if (ARRNELEMS(r) >= 2 * MAXNUMRANGE)
- elog(NOTICE, "Input array is too big (%d maximum allowed, %d current), use gist__intbig_ops opclass instead",
+ elog(NOTICE, "input array is too big (%d maximum allowed, %d current), use gist__intbig_ops opclass instead",
2 * MAXNUMRANGE - 1, ARRNELEMS(r));
retval = palloc(sizeof(GISTENTRY));
/*
* PostgreSQL type definitions for ISBNs.
*
- * $PostgreSQL: pgsql/contrib/isbn_issn/isbn_issn.c,v 1.7 2003/11/29 22:39:20 pgsql Exp $
+ * $PostgreSQL: pgsql/contrib/isbn_issn/isbn_issn.c,v 1.8 2006/03/01 06:30:31 neilc Exp $
*/
#include "postgres.h"
isbn_in(char *str)
{
isbn *result;
+ int len;
- if (strlen(str) != 13)
- {
+ len = strlen(str);
+ if (len != 13)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("invalid ISBN: \"%s\"", str),
- errdetail("incorrect length")));
+ errdetail("ISBNs must be 13 characters in length.")));
- return (NULL);
- }
if (isbn_sum(str) != 0)
- {
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("invalid ISBN: \"%s\"", str),
- errdetail("failed checksum")));
- return (NULL);
- }
+ errdetail("ISBN failed checksum.")));
result = (isbn *) palloc(sizeof(isbn));
-
- strncpy(result->num, str, 13);
+ memcpy(result->num, str, len);
memset(result->pad, ' ', 3);
return (result);
}
issn_in(char *str)
{
issn *result;
+ int len;
- if (strlen(str) != 9)
- {
+ len = strlen(str);
+ if (len != 9)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("invalid ISSN: \"%s\"", str),
- errdetail("incorrect length")));
+ errdetail("ISSNs must be 9 characters in length.")));
- return (NULL);
- }
if (issn_sum(str) != 0)
- {
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("invalid ISSN: \"%s\"", str),
- errdetail("failed checksum")));
- return (NULL);
- }
+ errdetail("ISSN failed checksum.")));
result = (issn *) palloc(sizeof(issn));
-
- strncpy(result->num, str, 9);
+ memcpy(result->num, str, len);
memset(result->pad, ' ', 7);
return (result);
}
} FieldNot;
static char *
-getlexem(char *start, char *end, int *len)
+getlexeme(char *start, char *end, int *len)
{
char *ptr;
}
bool
- compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
+compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
{
char *endt = t->name + t->len;
char *endq = qn + len;
lenq;
bool isok;
- while ((qn = getlexem(qn, endq, &lenq)) != NULL)
+ while ((qn = getlexeme(qn, endq, &lenq)) != NULL)
{
tn = t->name;
isok = false;
- while ((tn = getlexem(tn, endt, &lent)) != NULL)
+ while ((tn = getlexeme(tn, endt, &lent)) != NULL)
{
if (
(
{
cmpptr = (curvar->flag & LVAR_INCASE) ? pg_strncasecmp : strncmp;
- if (curvar->flag & LVAR_SUBLEXEM)
+ if (curvar->flag & LVAR_SUBLEXEME)
{
if (compare_subnode(curt, curvar->name, curvar->len, cmpptr, (curvar->flag & LVAR_ANYEND)))
return true;
#define LVAR_ANYEND 0x01
#define LVAR_INCASE 0x02
-#define LVAR_SUBLEXEM 0x04
+#define LVAR_SUBLEXEME 0x04
typedef struct
{
#define LQL_NOT 0x10
#ifdef LOWER_NODE
-#define FLG_CANLOOKSIGN(x) ( ( (x) & ( LQL_NOT | LVAR_ANYEND | LVAR_SUBLEXEM ) ) == 0 )
+#define FLG_CANLOOKSIGN(x) ( ( (x) & ( LQL_NOT | LVAR_ANYEND | LVAR_SUBLEXEME ) ) == 0 )
#else
-#define FLG_CANLOOKSIGN(x) ( ( (x) & ( LQL_NOT | LVAR_ANYEND | LVAR_SUBLEXEM | LVAR_INCASE ) ) == 0 )
+#define FLG_CANLOOKSIGN(x) ( ( (x) & ( LQL_NOT | LVAR_ANYEND | LVAR_SUBLEXEME | LVAR_INCASE ) ) == 0 )
#endif
#define LQL_CANLOOKSIGN(x) FLG_CANLOOKSIGN( ((lquery_level*)(x))->flag )
ereport(ERROR,
(errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"),
- errdetail("name length is %d, must " \
- "be < 256, in position %d",
+ errdetail("Name length is %d, must "
+ "be < 256, in position %d.",
lptr->len, (int) (lptr->start - buf))));
totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE);
ereport(ERROR,
(errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"),
- errdetail("name length is %d, must " \
- "be < 256, in position %d",
+ errdetail("Name length is %d, must "
+ "be < 256, in position %d.",
lptr->len, (int) (lptr->start - buf))));
totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE);
{
if (lptr->start == ptr)
UNCHAR;
- lptr->flag |= LVAR_SUBLEXEM;
- curqlevel->flag |= LVAR_SUBLEXEM;
+ lptr->flag |= LVAR_SUBLEXEME;
+ curqlevel->flag |= LVAR_SUBLEXEME;
}
else if (*ptr == '|')
{
lptr->len = ptr - lptr->start -
- ((lptr->flag & LVAR_SUBLEXEM) ? 1 : 0) -
+ ((lptr->flag & LVAR_SUBLEXEME) ? 1 : 0) -
((lptr->flag & LVAR_INCASE) ? 1 : 0) -
((lptr->flag & LVAR_ANYEND) ? 1 : 0);
if (lptr->len > 255)
ereport(ERROR,
(errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"),
- errdetail("name length is %d, must " \
- "be < 256, in position %d",
+ errdetail("Name length is %d, must "
+ "be < 256, in position %d.",
lptr->len, (int) (lptr->start - buf))));
state = LQPRS_WAITVAR;
else if (*ptr == '.')
{
lptr->len = ptr - lptr->start -
- ((lptr->flag & LVAR_SUBLEXEM) ? 1 : 0) -
+ ((lptr->flag & LVAR_SUBLEXEME) ? 1 : 0) -
((lptr->flag & LVAR_INCASE) ? 1 : 0) -
((lptr->flag & LVAR_ANYEND) ? 1 : 0);
if (lptr->len > 255)
ereport(ERROR,
(errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"),
- errdetail("name length is %d, must " \
- "be < 256, in position %d",
+ errdetail("Name length is %d, must "
+ "be < 256, in position %d.",
lptr->len, (int) (lptr->start - buf))));
state = LQPRS_WAITLEVEL;
errdetail("Unexpected end of line.")));
lptr->len = ptr - lptr->start -
- ((lptr->flag & LVAR_SUBLEXEM) ? 1 : 0) -
+ ((lptr->flag & LVAR_SUBLEXEME) ? 1 : 0) -
((lptr->flag & LVAR_INCASE) ? 1 : 0) -
((lptr->flag & LVAR_ANYEND) ? 1 : 0);
if (lptr->len == 0)
ereport(ERROR,
(errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"),
- errdetail("name length is %d, must " \
- "be < 256, in position %d",
+ errdetail("Name length is %d, must "
+ "be < 256, in position %d.",
lptr->len, (int) (lptr->start - buf))));
}
else if (state == LQPRS_WAITOPEN)
}
memcpy(ptr, curtlevel->name, curtlevel->len);
ptr += curtlevel->len;
- if ((curtlevel->flag & LVAR_SUBLEXEM))
+ if ((curtlevel->flag & LVAR_SUBLEXEME))
{
*ptr = '%';
ptr++;
(*lenval)++;
}
else if (*(state->buf) == '%')
- *flag |= LVAR_SUBLEXEM;
+ *flag |= LVAR_SUBLEXEME;
else if (*(state->buf) == '@')
*flag |= LVAR_INCASE;
else if (*(state->buf) == '*')
op++;
in->cur++;
}
- if (in->curpol->flag & LVAR_SUBLEXEM)
+ if (in->curpol->flag & LVAR_SUBLEXEME)
{
*(in->cur) = '%';
in->cur++;
cmpptr = (val->flag & LVAR_INCASE) ? pg_strncasecmp : strncmp;
while (tlen > 0)
{
- if (val->flag & LVAR_SUBLEXEM)
+ if (val->flag & LVAR_SUBLEXEME)
{
if (compare_subnode(level, op, val->length, cmpptr, (val->flag & LVAR_ANYEND)))
return true;
Datum
gtrgm_in(PG_FUNCTION_ARGS)
{
- elog(ERROR, "Not implemented");
+ elog(ERROR, "not implemented");
PG_RETURN_DATUM(0);
}
Datum
gtrgm_out(PG_FUNCTION_ARGS)
{
- elog(ERROR, "Not implemented");
+ elog(ERROR, "not implemented");
PG_RETURN_DATUM(0);
}
float4 nlimit = PG_GETARG_FLOAT4(0);
if (nlimit < 0 || nlimit > 1.0)
- elog(ERROR, "Wrong limit, should be between 0 and 1");
+ elog(ERROR, "wrong limit, should be between 0 and 1");
trgm_limit = nlimit;
PG_RETURN_FLOAT4(trgm_limit);
}
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("invalid return type"),
- errdetail("query-specified return " \
+ errdetail("Query-specified return " \
"tuple has %d columns but crosstab " \
- "returns %d", tupdesc->natts, result_ncols)));
+ "returns %d.", tupdesc->natts, result_ncols)));
/* allocate space */
values = (char **) palloc(result_ncols * sizeof(char *));
/* check that the type of the fifth column is INT4 */
if (show_branch && show_serial && tupdesc->attrs[4]->atttypid != INT4OID)
- elog(ERROR, "Query-specified return tuple not valid for Connectby: "
+ elog(ERROR, "query-specified return tuple not valid for Connectby: "
"fifth column must be type %s", format_type_be(INT4OID));
/* check that the type of the fifth column is INT4 */
if (!show_branch && show_serial && tupdesc->attrs[3]->atttypid != INT4OID)
- elog(ERROR, "Query-specified return tuple not valid for Connectby: "
+ elog(ERROR, "query-specified return tuple not valid for Connectby: "
"fourth column must be type %s", format_type_be(INT4OID));
/* OK, the tupdesc is valid for our purposes */
<pre>
SELECT to_tsquery('default', 'a|is&not|!the');
NOTICE: Query contains only stopword(s)
- or doesn't contain lexem(s), ignored
+ or doesn't contain lexeme(s), ignored
to_tsquery
-----------
(1 row)
tsearch2. This is not complicated, but is not very obvious to begin
with. The tsearch2 ISpell interface needs only the listing of
dictionary words, it will parse and load those words, and use the
-ISpell dictionary for lexem processing.</p>
+ISpell dictionary for lexeme processing.</p>
<p>I found the ISPell make system to be very finicky. Their
documentation actually states this to be the case. So I just did
WHERE dict_name = 'ispell_template');
</pre>
<p>Now that we have a dictionary we can specify it's use in a query
-to get a lexem. For this we will use the lexize function. The
+to get a lexeme. For this we will use the lexize function. The
lexize function takes the name of the dictionary to use as an
argument. Just as the other tsearch2 functions operate. You will
need to stop your psql session and start it again in order for this
<pre>
SELECT set_curdict('en_ispell');
</pre>
-<p>Lexize is meant to turn a word into a lexem. It is possible to
-receive more than one lexem returned for a single word.</p>
+<p>Lexize is meant to turn a word into a lexeme. It is possible to
+receive more than one lexeme returned for a single word.</p>
<pre>
SELECT lexize('en_ispell', 'conditionally');
lexize
(1 row)
</pre>
<p>The lexize function is not meant to take a full string as an
-argument to return lexems for. If you passed in an entire sentence,
+argument to return lexemes for. If you passed in an entire sentence,
it attempts to find that entire sentence in the dictionary. Since
the dictionary contains only words, you will receive an empty
result set back.</p>
(1 row)
-If you parse a lexem from a word not in the dictionary, then you will receive an empty result. This makes sense because the word "tsearch" is not in the english dictionary. You can create your own additions to the dictionary if you like. This may be useful for scientific or technical glossaries that need to be indexed. SELECT lexize('en_ispell', 'tsearch'); lexize -------- (1 row)
+If you parse a lexeme from a word not in the dictionary, then you will receive an empty result. This makes sense because the word "tsearch" is not in the english dictionary. You can create your own additions to the dictionary if you like. This may be useful for scientific or technical glossaries that need to be indexed. SELECT lexize('en_ispell', 'tsearch'); lexize -------- (1 row)
</pre>
<p>This is not to say that tsearch will be ignored when adding text
VALUES ('default_english', 'lword', '{en_ispell,en_stem}');
</pre>
<p>We have just inserted 3 records to the configuration mapping,
-specifying that the lexem types for "lhword, lpart_hword and lword"
+specifying that the lexeme types for "lhword, lpart_hword and lword"
are to be stemmed using the 'en_ispell' dictionary we added into
pg_ts_dict, when using the configuration ' default_english' which
we added to pg_ts_cfg.</p>
-<p>There are several other lexem types used that we do not need to
+<p>There are several other lexeme types used that we do not need to
specify as using the ISpell dictionary. We can simply insert values
using the 'simple' stemming process dictionary.</p>
<pre>
(1 row)
</pre>
<p>Notice here that words like "tsearch" are still parsed and
-indexed in the tsvector column. There is a lexem returned for the
+indexed in the tsvector column. There is a lexeme returned for the
word becuase in the configuration mapping table, we specify words
to be used from the 'en_ispell' dictionary first, but as a fallback
-to use the 'en_stem' dictionary. Therefore a lexem is not returned
+to use the 'en_stem' dictionary. Therefore a lexeme is not returned
from en_ispell, but is returned from en_stem, and added to the
tsvector.</p>
<pre>
<p>Notice in this last example I added the word "computer" to the
text to be converted into a tsvector. Because we have setup our
default configuration to use the ISpell english dictionary, the
-words are lexized, and computer returns 2 lexems at the same
+words are lexized, and computer returns 2 lexemes at the same
position. 'compute':7 and 'computer':7 are now both indexed for the
word computer.</p>
<p>You can create additional dictionary lists, or use the extra
<pre>
=# <b>SELECT to_tsquery('the')</b>
-NOTICE: Query contains only stopword(s) or doesn't contain lexem(s), ignored
+NOTICE: Query contains only stopword(s) or doesn't contain lexeme(s), ignored
to_tsquery
------------
char regerrstr[ERRSTRSIZE];
pg_regerror(err, &(Affix->reg.regex), regerrstr, ERRSTRSIZE);
- elog(ERROR, "Regex error in '%s': %s", Affix->mask, regerrstr);
+ elog(ERROR, "regex error in '%s': %s", Affix->mask, regerrstr);
}
Affix->compile = 0;
}
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("syntax error"),
- errdetail("Syntax error in position %d",
+ errdetail("Syntax error in position %d.",
(int) (ptr - VARDATA(in)))));
}
else if (state == CS_INKEY)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("syntax error"),
- errdetail("Syntax error in position %d",
+ errdetail("Syntax error in position %d.",
(int) (ptr - VARDATA(in)))));
}
else if (state == CS_WAITEQ)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("syntax error"),
- errdetail("Syntax error in position %d",
+ errdetail("Syntax error in position %d.",
(int) (ptr - VARDATA(in)))));
}
else if (state == CS_WAITVALUE)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("syntax error"),
- errdetail("Syntax error in position %d",
+ errdetail("Syntax error in position %d.",
(int) (ptr - VARDATA(in)))));
}
else if (state == CS_INESC)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("bad parser state"),
- errdetail("%d at position %d",
+ errdetail("%d at position %d.",
state, (int) (ptr - VARDATA(in)))));
ptr+=pg_mblen(ptr);
}
pfree(state.valstate.word);
if (!state.num)
{
- elog(NOTICE, "Query doesn't contain lexem(s)");
+ elog(NOTICE, "query doesn't contain lexeme(s)");
query = (QUERYTYPE *) palloc(HDRSIZEQT);
query->len = HDRSIZEQT;
query->size = 0;
resroot = clean_fakeval_intree(root, &result);
if (result != V_UNKNOWN)
{
- elog(NOTICE, "Query contains only stopword(s) or doesn't contain lexem(s), ignored");
+ elog(NOTICE, "query contains only stopword(s) or doesn't contain lexeme(s), ignored");
*len = 0;
return NULL;
}
Datum
gtsq_in(PG_FUNCTION_ARGS)
{
- elog(ERROR, "Not implemented");
+ elog(ERROR, "not implemented");
PG_RETURN_DATUM(0);
}
Datum
gtsq_out(PG_FUNCTION_ARGS)
{
- elog(ERROR, "Not implemented");
+ elog(ERROR, "not implemented");
PG_RETURN_DATUM(0);
}
if (SPI_processed < 0)
/* internal error */
- elog(ERROR, "There is no tsvector type");
+ elog(ERROR, "there is no tsvector type");
tsqOid = DatumGetObjectId(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1, &isnull));
if (tsqOid == InvalidOid)
/* internal error */
#endif
}
- if (type >= cfg->len) /* skip this type of lexem */
+ if (type >= cfg->len) /* skip this type of lexeme */
continue;
for (i = 0; i < cfg->map[type].len; i++)
PointerGetDatum(lenlemm)
)
);
- if (!norms) /* dictionary doesn't know this lexem */
+ if (!norms) /* dictionary doesn't know this lexeme */
continue;
prs->pos++; /* set pos */
prs->curwords++;
}
pfree(norms);
- break; /* lexem already normalized or is stop word */
+ break; /* lexeme already normalized or is stop word */
}
}
PointerGetDatum(lenlemm)
)
);
- if (!norms) /* dictionary doesn't know this lexem */
+ if (!norms) /* dictionary doesn't know this lexeme */
continue;
while (ptr->lexeme)
ptr++;
}
pfree(norms);
- break; /* lexem already normalized or is stop word */
+ break; /* lexeme already normalized or is stop word */
}
}
if (SPI_processed < 1)
/* internal error */
- elog(ERROR, "There is no tsvector type");
+ elog(ERROR, "there is no tsvector type");
tiOid = DatumGetObjectId(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1, &isnull));
if (tiOid == InvalidOid)
/* internal error */
/*
* In/Out definitions for tsvector type
* Internal structure:
- * string of values, array of position lexem in string and it's length
+ * string of values, array of position lexeme in string and it's length
* Teodor Sigaev <teodor@sigaev.ru>
*/
#include "postgres.h"
typedef struct
{
int type;
- char *lexem;
-} LexemEntry;
+ char *lexeme;
+} LexemeEntry;
typedef struct
{
- int cur;
- int len;
- LexemEntry *list;
+ int cur;
+ int len;
+ LexemeEntry *list;
} PrsStorage;
st = (PrsStorage *) palloc(sizeof(PrsStorage));
st->cur = 0;
st->len = 16;
- st->list = (LexemEntry *) palloc(sizeof(LexemEntry) * st->len);
+ st->list = (LexemeEntry *) palloc(sizeof(LexemeEntry) * st->len);
prs->prs = (void *) DatumGetPointer(
FunctionCall2(
if (st->cur >= st->len)
{
st->len = 2 * st->len;
- st->list = (LexemEntry *) repalloc(st->list, sizeof(LexemEntry) * st->len);
+ st->list = (LexemeEntry *) repalloc(st->list, sizeof(LexemeEntry) * st->len);
}
- st->list[st->cur].lexem = palloc(llen + 1);
- memcpy(st->list[st->cur].lexem, lex, llen);
- st->list[st->cur].lexem[llen] = '\0';
+ st->list[st->cur].lexeme = palloc(llen + 1);
+ memcpy(st->list[st->cur].lexeme, lex, llen);
+ st->list[st->cur].lexeme[llen] = '\0';
st->list[st->cur].type = type;
st->cur++;
}
values[0] = tid;
sprintf(tid, "%d", st->list[st->cur].type);
- values[1] = st->list[st->cur].lexem;
+ values[1] = st->list[st->cur].lexeme;
tuple = BuildTupleFromCStrings(funcctx->attinmeta, values);
result = HeapTupleGetDatum(tuple);
break;
default:
- elog(NOTICE, "Unsupported XQuery result: %d", res->type);
+ elog(NOTICE, "unsupported XQuery result: %d", res->type);
xpresstr = xmlStrdup("<unsupported/>");
}
if (spi_tupdesc->natts != 2)
{
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("Expression returning multiple columns is not valid in parameter list"),
- errdetail("Expected two columns in SPI result, got %d", spi_tupdesc->natts)));
+ errmsg("expression returning multiple columns is not valid in parameter list"),
+ errdetail("Expected two columns in SPI result, got %d.", spi_tupdesc->natts)));
}
/* Setup the parser. Beware that this must happen in the same context as the
break;
default:
- elog(NOTICE, "Unsupported XQuery result: %d", res->type);
+ elog(NOTICE, "unsupported XQuery result: %d", res->type);
resstr = xmlStrdup("<unsupported/>");
}
if (doctree == NULL)
{
xmlCleanupParser();
- elog_error(ERROR, "Error parsing XML document", 0);
+ elog_error(ERROR, "error parsing XML document", 0);
PG_RETURN_NULL();
}
{
xmlFreeDoc(doctree);
xmlCleanupParser();
- elog_error(ERROR, "Error parsing stylesheet as XML document", 0);
+ elog_error(ERROR, "error parsing stylesheet as XML document", 0);
PG_RETURN_NULL();
}
xmlFreeDoc(doctree);
xsltCleanupGlobals();
xmlCleanupParser();
- elog_error(ERROR, "Failed to parse stylesheet", 0);
+ elog_error(ERROR, "failed to parse stylesheet", 0);
PG_RETURN_NULL();
}
<!--
-$PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.49 2005/11/04 23:14:00 petere Exp $
+$PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.50 2006/03/01 06:30:32 neilc Exp $
-->
<chapter id="plperl">
my $t = localtime;
elog(NOTICE, "opening file $file at $t" );
open my $fh, '<', $file # ooh, it's a file access!
- or elog(ERROR, "Can't open $file for reading: $!");
+ or elog(ERROR, "can't open $file for reading: $!");
my @words = <$fh>;
close $fh;
$t = localtime;
CREATE FUNCTION badfunc() RETURNS integer AS $$
my $tmpfile = "/tmp/badfile";
open my $fh, '>', $tmpfile
- or elog(ERROR, qq{Could not open the file "$tmpfile": $!});
+ or elog(ERROR, qq{could not open the file "$tmpfile": $!});
print $fh "Testing writing to a file\n";
- close $fh or elog(ERROR, qq{Could not close the file "$tmpfile": $!});
+ close $fh or elog(ERROR, qq{could not close the file "$tmpfile": $!});
return 1;
$$ LANGUAGE plperl;
</programlisting>
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.34 2006/01/21 04:38:21 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.35 2006/03/01 06:30:32 neilc Exp $
*
*-------------------------------------------------------------------------
*/
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not access status of transaction %u", xid),
- errdetail("could not open file \"%s\": %m",
- path)));
+ errdetail("Could not open file \"%s\": %m.", path)));
break;
case SLRU_SEEK_FAILED:
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not access status of transaction %u", xid),
- errdetail("could not seek in file \"%s\" to offset %u: %m",
+ errdetail("Could not seek in file \"%s\" to offset %u: %m.",
path, offset)));
break;
case SLRU_READ_FAILED:
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not access status of transaction %u", xid),
- errdetail("could not read from file \"%s\" at offset %u: %m",
+ errdetail("Could not read from file \"%s\" at offset %u: %m.",
path, offset)));
break;
case SLRU_WRITE_FAILED:
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not access status of transaction %u", xid),
- errdetail("could not write to file \"%s\" at offset %u: %m",
+ errdetail("Could not write to file \"%s\" at offset %u: %m.",
path, offset)));
break;
case SLRU_FSYNC_FAILED:
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not access status of transaction %u", xid),
- errdetail("could not fsync file \"%s\": %m",
+ errdetail("Could not fsync file \"%s\": %m.",
path)));
break;
case SLRU_CLOSE_FAILED:
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not access status of transaction %u", xid),
- errdetail("could not close file \"%s\": %m",
+ errdetail("Could not close file \"%s\": %m.",
path)));
break;
default:
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.44 2005/10/15 02:49:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.45 2006/03/01 06:30:32 neilc Exp $
*
*-------------------------------------------------------------------------
*/
UsedShmemSegAddr = origUsedShmemSegAddr;
#endif
- elog(DEBUG3, "Attaching to %p", UsedShmemSegAddr);
+ elog(DEBUG3, "attaching to %p", UsedShmemSegAddr);
hdr = (void *) PGSharedMemoryAttach((IpcMemoryKey) UsedShmemSegID, &shmid);
if (hdr == NULL)
elog(FATAL, "could not reattach to shared memory (key=%d, addr=%p): %m",
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.73 2006/02/28 20:56:14 neilc Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.74 2006/03/01 06:30:32 neilc Exp $
*
*********************************************************************
*/
ereport(ERROR,
(errcode(ERRCODE_DATA_EXCEPTION),
errmsg("unexpected return value from trigger procedure"),
- errdetail("expected None or a String")));
+ errdetail("Expected None or a String.")));
srv = PyString_AsString(plrv);
if (pg_strcasecmp(srv, "SKIP") == 0)
ereport(ERROR,
(errcode(ERRCODE_DATA_EXCEPTION),
errmsg("unexpected return value from trigger procedure"),
- errdetail("expected None, \"OK\", \"SKIP\", or \"MODIFY\"")));
+ errdetail("Expected None, \"OK\", \"SKIP\", or \"MODIFY\".")));
}
}
}
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("invalid return value from plpython function"),
- errdetail("Functions returning type \"void\" must return \"None\".")));
+ errdetail("Functions returning type \"void\" must return None.")));
fcinfo->isnull = false;
rv = (Datum) 0;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/tutorial/beard.c,v 1.13 2005/10/15 02:49:52 momjian Exp $
+ * $PostgreSQL: pgsql/src/tutorial/beard.c,v 1.14 2006/03/01 06:30:32 neilc Exp $
*
*-------------------------------------------------------------------------
*/
ObjectIdGetDatum(picture),
Int32GetDatum(INV_READ)));
if (pic_fd < 0)
- elog(ERROR, "Cannot access picture large object");
+ elog(ERROR, "could not access picture large object");
if (lo_read(pic_fd, (char *) &ihdr, sizeof(ihdr)) != sizeof(ihdr))
- elog(ERROR, "Picture large object corrupted");
+ elog(ERROR, "picture large object corrupted");
beardOffset = (ihdr.size / 3) * 2;
beard = DatumGetObjectId(DirectFunctionCall1(lo_creat,
Int32GetDatum(INV_MD)));
if (beard == InvalidOid)
- elog(ERROR, "Cannot create new large object");
+ elog(ERROR, "could not create new large object");
beard_fd = DatumGetInt32(DirectFunctionCall2(lo_open,
ObjectIdGetDatum(beard),
Int32GetDatum(INV_WRITE)));
if (beard_fd < 0)
- elog(ERROR, "Cannot access beard large object");
+ elog(ERROR, "could not access beard large object");
if (DatumGetInt32(DirectFunctionCall3(lo_lseek,
Int32GetDatum(pic_fd),
Int32GetDatum(beardOffset),
Int32GetDatum(SEEK_SET))) < 0)
- elog(ERROR, "Cannot seek in picture large object");
+ elog(ERROR, "could not seek in picture large object");
while ((cc = lo_read(pic_fd, buf, BUFSIZE)) > 0)
{