@ -6,7 +6,7 @@
* Portions Copyright ( c ) 1996 - 2007 , PostgreSQL Global Development Group
* Portions Copyright ( c ) 1996 - 2007 , PostgreSQL Global Development Group
* Portions Copyright ( c ) 1994 , Regents of the University of California
* Portions Copyright ( c ) 1994 , Regents of the University of California
*
*
* $ PostgreSQL : pgsql / src / backend / parser / analyze . c , v 1.359 2007 / 01 / 12 19 : 34 : 41 momjian Exp $
* $ PostgreSQL : pgsql / src / backend / parser / analyze . c , v 1.360 2007 / 02 / 01 19 : 10 : 27 momjian Exp $
*
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
*/
@ -646,7 +646,7 @@ transformInsertStmt(ParseState *pstate, InsertStmt *stmt,
if ( selectQuery - > into )
if ( selectQuery - > into )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_SYNTAX_ERROR ) ,
( errcode ( ERRCODE_SYNTAX_ERROR ) ,
errmsg ( " INSERT ... SELECT may not specify INTO " ) ) ) ;
errmsg ( " INSERT ... SELECT can not specify INTO " ) ) ) ;
/*
/*
* Make the source be a subquery in the INSERT ' s rangetable , and add
* Make the source be a subquery in the INSERT ' s rangetable , and add
@ -1803,7 +1803,7 @@ transformIndexStmt(ParseState *pstate, IndexStmt *stmt)
if ( expression_returns_set ( ielem - > expr ) )
if ( expression_returns_set ( ielem - > expr ) )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_DATATYPE_MISMATCH ) ,
( errcode ( ERRCODE_DATATYPE_MISMATCH ) ,
errmsg ( " index expression may not return a set " ) ) ) ;
errmsg ( " index expression can not return a set " ) ) ) ;
}
}
}
}
@ -1892,7 +1892,7 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
if ( list_length ( pstate - > p_rtable ) ! = 2 ) /* naughty, naughty... */
if ( list_length ( pstate - > p_rtable ) ! = 2 ) /* naughty, naughty... */
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " rule WHERE condition may not contain references to other relations " ) ) ) ;
errmsg ( " rule WHERE condition can not contain references to other relations " ) ) ) ;
/* aggregates not allowed (but subselects are okay) */
/* aggregates not allowed (but subselects are okay) */
if ( pstate - > p_hasAggs )
if ( pstate - > p_hasAggs )
@ -1967,7 +1967,7 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
stmt - > whereClause ! = NULL )
stmt - > whereClause ! = NULL )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " rules with WHERE conditions may only have SELECT, INSERT, UPDATE, or DELETE actions " ) ) ) ;
errmsg ( " rules with WHERE conditions can only have SELECT, INSERT, UPDATE, or DELETE actions " ) ) ) ;
/*
/*
* If the action is INSERT . . . SELECT , OLD / NEW have been pushed down
* If the action is INSERT . . . SELECT , OLD / NEW have been pushed down
@ -2003,11 +2003,11 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
if ( has_old )
if ( has_old )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " ON SELECT rule may not use OLD " ) ) ) ;
errmsg ( " ON SELECT rule can not use OLD " ) ) ) ;
if ( has_new )
if ( has_new )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " ON SELECT rule may not use NEW " ) ) ) ;
errmsg ( " ON SELECT rule can not use NEW " ) ) ) ;
break ;
break ;
case CMD_UPDATE :
case CMD_UPDATE :
/* both are OK */
/* both are OK */
@ -2016,13 +2016,13 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
if ( has_old )
if ( has_old )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " ON INSERT rule may not use OLD " ) ) ) ;
errmsg ( " ON INSERT rule can not use OLD " ) ) ) ;
break ;
break ;
case CMD_DELETE :
case CMD_DELETE :
if ( has_new )
if ( has_new )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " ON DELETE rule may not use NEW " ) ) ) ;
errmsg ( " ON DELETE rule can not use NEW " ) ) ) ;
break ;
break ;
default :
default :
elog ( ERROR , " unrecognized event type: %d " ,
elog ( ERROR , " unrecognized event type: %d " ,
@ -2663,7 +2663,7 @@ transformSetOperationTree(ParseState *pstate, SelectStmt *stmt)
if ( contain_vars_of_level ( ( Node * ) selectQuery , 1 ) )
if ( contain_vars_of_level ( ( Node * ) selectQuery , 1 ) )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_COLUMN_REFERENCE ) ,
( errcode ( ERRCODE_INVALID_COLUMN_REFERENCE ) ,
errmsg ( " UNION/INTERSECT/EXCEPT member statement may not refer to other relations of same query level " ) ) ) ;
errmsg ( " UNION/INTERSECT/EXCEPT member statement can not refer to other relations of same query level " ) ) ) ;
}
}
/*
/*
@ -2987,7 +2987,7 @@ transformReturningList(ParseState *pstate, List *returningList)
if ( list_length ( pstate - > p_rtable ) ! = length_rtable )
if ( list_length ( pstate - > p_rtable ) ! = length_rtable )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_FEATURE_NOT_SUPPORTED ) ,
( errcode ( ERRCODE_FEATURE_NOT_SUPPORTED ) ,
errmsg ( " RETURNING may not contain references to other relations " ) ) ) ;
errmsg ( " RETURNING can not contain references to other relations " ) ) ) ;
/* mark column origins */
/* mark column origins */
markTargetListOrigins ( pstate , rlist ) ;
markTargetListOrigins ( pstate , rlist ) ;
@ -3206,7 +3206,7 @@ transformDeclareCursorStmt(ParseState *pstate, DeclareCursorStmt *stmt)
if ( ( ( Query * ) stmt - > query ) - > into )
if ( ( ( Query * ) stmt - > query ) - > into )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_CURSOR_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_CURSOR_DEFINITION ) ,
errmsg ( " DECLARE CURSOR may not specify INTO " ) ) ) ;
errmsg ( " DECLARE CURSOR can not specify INTO " ) ) ) ;
return result ;
return result ;
}
}