Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian1998-01-05 16:40:20 +0000
committerBruce Momjian1998-01-05 16:40:20 +0000
commitdeea69b90efa866544de6dd34b6e01c04f09806f (patch)
tree27a30d675e37a94fc384ea9c0cc69062e50c2244 /src/backend/parser
parent3d8820a364b3627b537b44b9cb23dc40a3c84144 (diff)
Change some ABORTS to ERROR. Add line number when COPY Failure.
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y96
-rw-r--r--src/backend/parser/scan.l26
2 files changed, 61 insertions, 61 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index daa2aab1bba..2262fbc067d 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.84 1998/01/05 03:32:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.85 1998/01/05 16:39:16 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -590,17 +590,17 @@ alter_clause: ADD opt_column columnDef
Node *lp = lfirst($3);
if (length($3) != 1)
- elog(ABORT,"ALTER TABLE/ADD() allows one column only",NULL);
+ elog(ERROR,"ALTER TABLE/ADD() allows one column only",NULL);
$$ = lp;
}
| DROP opt_column ColId
- { elog(ABORT,"ALTER TABLE/DROP COLUMN not yet implemented",NULL); }
+ { elog(ERROR,"ALTER TABLE/DROP COLUMN not yet implemented",NULL); }
| ALTER opt_column ColId SET DEFAULT default_expr
- { elog(ABORT,"ALTER TABLE/ALTER COLUMN/SET DEFAULT not yet implemented",NULL); }
+ { elog(ERROR,"ALTER TABLE/ALTER COLUMN/SET DEFAULT not yet implemented",NULL); }
| ALTER opt_column ColId DROP DEFAULT
- { elog(ABORT,"ALTER TABLE/ALTER COLUMN/DROP DEFAULT not yet implemented",NULL); }
+ { elog(ERROR,"ALTER TABLE/ALTER COLUMN/DROP DEFAULT not yet implemented",NULL); }
| ADD ConstraintElem
- { elog(ABORT,"ALTER TABLE/ADD CONSTRAINT not yet implemented",NULL); }
+ { elog(ERROR,"ALTER TABLE/ADD CONSTRAINT not yet implemented",NULL); }
;
@@ -811,11 +811,11 @@ default_expr: AexprConst
| default_expr '*' default_expr
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
| default_expr '=' default_expr
- { elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
+ { elog(ERROR,"boolean expressions not supported in DEFAULT",NULL); }
| default_expr '<' default_expr
- { elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
+ { elog(ERROR,"boolean expressions not supported in DEFAULT",NULL); }
| default_expr '>' default_expr
- { elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
+ { elog(ERROR,"boolean expressions not supported in DEFAULT",NULL); }
| ':' default_expr
{ $$ = lcons( makeString( ":"), $2); }
| ';' default_expr
@@ -848,7 +848,7 @@ default_expr: AexprConst
| default_expr Op default_expr
{
if (!strcmp("<=", $2) || !strcmp(">=", $2))
- elog(ABORT,"boolean expressions not supported in DEFAULT",NULL);
+ elog(ERROR,"boolean expressions not supported in DEFAULT",NULL);
$$ = nconc( $1, lcons( makeString( $2), $3));
}
| Op default_expr
@@ -1200,13 +1200,13 @@ TriggerOneEvent: INSERT { $$ = 'i'; }
TriggerForSpec: FOR name name
{
if ( strcmp ($2, "each") != 0 )
- elog(ABORT,"parser: syntax error near %s",$2);
+ elog(ERROR,"parser: syntax error near %s",$2);
if ( strcmp ($3, "row") == 0 )
$$ = TRUE;
else if ( strcmp ($3, "statement") == 0 )
$$ = FALSE;
else
- elog(ABORT,"parser: syntax error near %s",$3);
+ elog(ERROR,"parser: syntax error near %s",$3);
}
;
@@ -1379,7 +1379,7 @@ opt_direction: FORWARD { $$ = FORWARD; }
fetch_how_many: Iconst
{ $$ = $1;
- if ($1 <= 0) elog(ABORT,"Please specify nonnegative count for fetch",NULL); }
+ if ($1 <= 0) elog(ERROR,"Please specify nonnegative count for fetch",NULL); }
| ALL { $$ = 0; /* 0 means fetch all tuples*/ }
| /*EMPTY*/ { $$ = 1; /*default*/ }
;
@@ -1597,7 +1597,7 @@ RecipeStmt: EXECUTE RECIPE recipe_name
{
RecipeStmt *n;
if (!IsTransactionBlock())
- elog(ABORT,"EXECUTE RECIPE may only be used in begin/end transaction blocks",NULL);
+ elog(ERROR,"EXECUTE RECIPE may only be used in begin/end transaction blocks",NULL);
n = makeNode(RecipeStmt);
n->recipeName = $3;
@@ -1725,7 +1725,7 @@ MathOp: '+' { $$ = "+"; }
oper_argtypes: name
{
- elog(ABORT,"parser: argument type missing (use NONE for unary operators)",NULL);
+ elog(ERROR,"parser: argument type missing (use NONE for unary operators)",NULL);
}
| name ',' name
{ $$ = makeList(makeString($1), makeString($3), -1); }
@@ -2063,7 +2063,7 @@ VacuumStmt: VACUUM opt_verbose opt_analyze
n->vacrel = $4;
n->va_spec = $5;
if ( $5 != NIL && !$4 )
- elog(ABORT,"parser: syntax error at or near \"(\"",NULL);
+ elog(ERROR,"parser: syntax error at or near \"(\"",NULL);
$$ = (Node *)n;
}
;
@@ -2240,7 +2240,7 @@ CursorStmt: DECLARE name opt_binary CURSOR FOR
* -- mao
*/
if (!IsTransactionBlock())
- elog(ABORT,"Named portals may only be used in begin/end transaction blocks",NULL);
+ elog(ERROR,"Named portals may only be used in begin/end transaction blocks",NULL);
n->portalname = $2;
n->binary = $3;
@@ -2444,7 +2444,7 @@ having_clause: HAVING a_expr { $$ = $2; }
from_clause: FROM '(' relation_expr join_expr JOIN relation_expr join_spec ')'
{
$$ = NIL;
- elog(ABORT,"JOIN not yet implemented",NULL);
+ elog(ERROR,"JOIN not yet implemented",NULL);
}
| FROM from_list { $$ = $2; }
| /*EMPTY*/ { $$ = NIL; }
@@ -2453,7 +2453,7 @@ from_clause: FROM '(' relation_expr join_expr JOIN relation_expr join_spec ')'
from_list: from_list ',' from_val
{ $$ = lappend($1, $3); }
| from_val CROSS JOIN from_val
- { elog(ABORT,"CROSS JOIN not yet implemented",NULL); }
+ { elog(ERROR,"CROSS JOIN not yet implemented",NULL); }
| from_val
{ $$ = lcons($1, NIL); }
;
@@ -2480,19 +2480,19 @@ from_val: relation_expr AS ColLabel
join_expr: NATURAL join_expr { $$ = NULL; }
| FULL join_outer
- { elog(ABORT,"FULL OUTER JOIN not yet implemented",NULL); }
+ { elog(ERROR,"FULL OUTER JOIN not yet implemented",NULL); }
| LEFT join_outer
- { elog(ABORT,"LEFT OUTER JOIN not yet implemented",NULL); }
+ { elog(ERROR,"LEFT OUTER JOIN not yet implemented",NULL); }
| RIGHT join_outer
- { elog(ABORT,"RIGHT OUTER JOIN not yet implemented",NULL); }
+ { elog(ERROR,"RIGHT OUTER JOIN not yet implemented",NULL); }
| OUTER_P
- { elog(ABORT,"OUTER JOIN not yet implemented",NULL); }
+ { elog(ERROR,"OUTER JOIN not yet implemented",NULL); }
| INNER_P
- { elog(ABORT,"INNER JOIN not yet implemented",NULL); }
+ { elog(ERROR,"INNER JOIN not yet implemented",NULL); }
| UNION
- { elog(ABORT,"UNION JOIN not yet implemented",NULL); }
+ { elog(ERROR,"UNION JOIN not yet implemented",NULL); }
| /*EMPTY*/
- { elog(ABORT,"INNER JOIN not yet implemented",NULL); }
+ { elog(ERROR,"INNER JOIN not yet implemented",NULL); }
;
join_outer: OUTER_P { $$ = NULL; }
@@ -2653,13 +2653,13 @@ Numeric: FLOAT opt_float
opt_float: '(' Iconst ')'
{
if ($2 < 1)
- elog(ABORT,"precision for FLOAT must be at least 1",NULL);
+ elog(ERROR,"precision for FLOAT must be at least 1",NULL);
else if ($2 < 7)
$$ = xlateSqlType("float4");
else if ($2 < 16)
$$ = xlateSqlType("float8");
else
- elog(ABORT,"precision for FLOAT must be less than 16",NULL);
+ elog(ERROR,"precision for FLOAT must be less than 16",NULL);
}
| /*EMPTY*/
{
@@ -2670,14 +2670,14 @@ opt_float: '(' Iconst ')'
opt_numeric: '(' Iconst ',' Iconst ')'
{
if ($2 != 9)
- elog(ABORT,"NUMERIC precision %d must be 9",$2);
+ elog(ERROR,"NUMERIC precision %d must be 9",$2);
if ($4 != 0)
- elog(ABORT,"NUMERIC scale %d must be zero",$4);
+ elog(ERROR,"NUMERIC scale %d must be zero",$4);
}
| '(' Iconst ')'
{
if ($2 != 9)
- elog(ABORT,"NUMERIC precision %d must be 9",$2);
+ elog(ERROR,"NUMERIC precision %d must be 9",$2);
}
| /*EMPTY*/
{
@@ -2688,15 +2688,15 @@ opt_numeric: '(' Iconst ',' Iconst ')'
opt_decimal: '(' Iconst ',' Iconst ')'
{
if ($2 > 9)
- elog(ABORT,"DECIMAL precision %d exceeds implementation limit of 9",$2);
+ elog(ERROR,"DECIMAL precision %d exceeds implementation limit of 9",$2);
if ($4 != 0)
- elog(ABORT,"DECIMAL scale %d must be zero",$4);
+ elog(ERROR,"DECIMAL scale %d must be zero",$4);
$$ = NULL;
}
| '(' Iconst ')'
{
if ($2 > 9)
- elog(ABORT,"DECIMAL precision %d exceeds implementation limit of 9",$2);
+ elog(ERROR,"DECIMAL precision %d exceeds implementation limit of 9",$2);
$$ = NULL;
}
| /*EMPTY*/
@@ -2722,14 +2722,14 @@ Character: character '(' Iconst ')'
else
yyerror("parse error");
if ($3 < 1)
- elog(ABORT,"length for '%s' type must be at least 1",$1);
+ elog(ERROR,"length for '%s' type must be at least 1",$1);
else if ($3 > 4096)
/* we can store a char() of length up to the size
* of a page (8KB) - page headers and friends but
* just to be safe here... - ay 6/95
* XXX note this hardcoded limit - thomas 1997-07-13
*/
- elog(ABORT,"length for type '%s' cannot exceed 4096",$1);
+ elog(ERROR,"length for type '%s' cannot exceed 4096",$1);
/* we actually implement this sort of like a varlen, so
* the first 4 bytes is the length. (the difference
@@ -2762,7 +2762,7 @@ character: CHARACTER opt_varying opt_charset opt_collate
}
};
if ($4 != NULL)
- elog(ABORT,"COLLATE %s not yet implemented",$4);
+ elog(ERROR,"COLLATE %s not yet implemented",$4);
$$ = type;
}
| CHAR opt_varying { $$ = xlateSqlType($2? "varchar": "char"); }
@@ -3098,7 +3098,7 @@ a_expr: attr opt_indirection
*/
| EXISTS '(' SubSelect ')'
{
- elog(ABORT,"EXISTS not yet implemented",NULL);
+ elog(ERROR,"EXISTS not yet implemented",NULL);
$$ = $3;
}
| EXTRACT '(' extract_list ')'
@@ -3428,7 +3428,7 @@ trim_list: a_expr FROM expr_list
in_expr: SubSelect
{
- elog(ABORT,"IN (SUBSELECT) not yet implemented",NULL);
+ elog(ERROR,"IN (SUBSELECT) not yet implemented",NULL);
$$ = $1;
}
| in_expr_nodes
@@ -3445,7 +3445,7 @@ in_expr_nodes: AexprConst
not_in_expr: SubSelect
{
- elog(ABORT,"NOT IN (SUBSELECT) not yet implemented",NULL);
+ elog(ERROR,"NOT IN (SUBSELECT) not yet implemented",NULL);
$$ = $1;
}
| not_in_expr_nodes
@@ -3606,7 +3606,7 @@ relation_name: SpecialRuleRelation
/* disallow refs to variable system tables */
if (strcmp(LogRelationName, $1) == 0
|| strcmp(VariableRelationName, $1) == 0)
- elog(ABORT,"%s cannot be accessed by users",$1);
+ elog(ERROR,"%s cannot be accessed by users",$1);
else
$$ = $1;
StrNCpy(saved_relname, $1, NAMEDATALEN);
@@ -3765,14 +3765,14 @@ SpecialRuleRelation: CURRENT
if (QueryIsRule)
$$ = "*CURRENT*";
else
- elog(ABORT,"CURRENT used in non-rule query",NULL);
+ elog(ERROR,"CURRENT used in non-rule query",NULL);
}
| NEW
{
if (QueryIsRule)
$$ = "*NEW*";
else
- elog(ABORT,"NEW used in non-rule query",NULL);
+ elog(ERROR,"NEW used in non-rule query",NULL);
}
;
@@ -3800,7 +3800,7 @@ makeRowExpr(char *opr, List *largs, List *rargs)
Node *larg, *rarg;
if (length(largs) != length(rargs))
- elog(ABORT,"Unequal number of entries in row expression",NULL);
+ elog(ERROR,"Unequal number of entries in row expression",NULL);
if (lnext(largs) != NIL)
expr = makeRowExpr(opr,lnext(largs),lnext(rargs));
@@ -3828,7 +3828,7 @@ makeRowExpr(char *opr, List *largs, List *rargs)
}
else
{
- elog(ABORT,"Operator '%s' not implemented for row expressions",opr);
+ elog(ERROR,"Operator '%s' not implemented for row expressions",opr);
}
#if FALSE
@@ -3858,7 +3858,7 @@ mapTargetColumns(List *src, List *dst)
ResTarget *d;
if (length(src) != length(dst))
- elog(ABORT,"CREATE TABLE/AS SELECT has mismatched column count",NULL);
+ elog(ERROR,"CREATE TABLE/AS SELECT has mismatched column count",NULL);
while ((src != NIL) && (dst != NIL))
{
@@ -4069,7 +4069,7 @@ makeConstantList( A_Const *n)
{
char *defval = NULL;
if (nodeTag(n) != T_A_Const) {
- elog(ABORT,"Cannot handle non-constant parameter",NULL);
+ elog(ERROR,"Cannot handle non-constant parameter",NULL);
} else if (n->val.type == T_Float) {
defval = (char*) palloc(20+1);
@@ -4086,7 +4086,7 @@ makeConstantList( A_Const *n)
strcat( defval, "'");
} else {
- elog(ABORT,"Internal error in makeConstantList(): cannot encode node",NULL);
+ elog(ERROR,"Internal error in makeConstantList(): cannot encode node",NULL);
};
#ifdef PARSEDEBUG
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index 1617472fbc3..95a5cc31f2c 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.33 1998/01/05 03:32:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.34 1998/01/05 16:39:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -199,13 +199,13 @@ other .
errno = 0;
yylval.ival = strtol((char *)literal,&endptr,2);
if (*endptr != '\0' || errno == ERANGE)
- elog(ABORT,"Bad binary integer input '%s'",literal);
+ elog(ERROR,"Bad binary integer input '%s'",literal);
return (ICONST);
}
<xh>{xhinside} |
<xb>{xbinside} {
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
- elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
+ elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng;
}
@@ -225,7 +225,7 @@ other .
errno = 0;
yylval.ival = strtol((char *)literal,&endptr,16);
if (*endptr != '\0' || errno == ERANGE)
- elog(ABORT,"Bad hexadecimal integer input '%s'",literal);
+ elog(ERROR,"Bad hexadecimal integer input '%s'",literal);
return (ICONST);
}
@@ -242,13 +242,13 @@ other .
<xq>{xqdouble} |
<xq>{xqinside} {
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
- elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
+ elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng;
}
<xq>{xqembedded} {
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
- elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
+ elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
*(literal+llen) = '\'';
llen += yyleng;
@@ -256,7 +256,7 @@ other .
<xq>{xqliteral} {
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
- elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
+ elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng;
}
@@ -276,7 +276,7 @@ other .
}
<xd>{xdinside} {
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
- elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
+ elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng;
}
@@ -318,7 +318,7 @@ other .
errno = 0;
yylval.ival = strtol((char *)yytext,&endptr,10);
if (*endptr != '\0' || errno == ERANGE)
- elog(ABORT,"Bad integer input '%s'",yytext);
+ elog(ERROR,"Bad integer input '%s'",yytext);
return (ICONST);
}
{real}/{space}*-{number} {
@@ -328,7 +328,7 @@ other .
errno = 0;
yylval.dval = strtod(((char *)yytext),&endptr);
if (*endptr != '\0' || errno == ERANGE)
- elog(ABORT,"Bad float8 input '%s'",yytext);
+ elog(ERROR,"Bad float8 input '%s'",yytext);
CheckFloat8Val(yylval.dval);
return (FCONST);
}
@@ -338,7 +338,7 @@ other .
errno = 0;
yylval.ival = strtol((char *)yytext,&endptr,10);
if (*endptr != '\0' || errno == ERANGE)
- elog(ABORT,"Bad integer input '%s'",yytext);
+ elog(ERROR,"Bad integer input '%s'",yytext);
return (ICONST);
}
{real} {
@@ -347,7 +347,7 @@ other .
errno = 0;
yylval.dval = strtod((char *)yytext,&endptr);
if (*endptr != '\0' || errno == ERANGE)
- elog(ABORT,"Bad float input '%s'",yytext);
+ elog(ERROR,"Bad float input '%s'",yytext);
CheckFloat8Val(yylval.dval);
return (FCONST);
}
@@ -377,7 +377,7 @@ other .
void yyerror(char message[])
{
- elog(ABORT, "parser: %s at or near \"%s\"", message, yytext);
+ elog(ERROR, "parser: %s at or near \"%s\"", message, yytext);
}
int yywrap()