Commit a49ceda6 authored by Peter Eisentraut's avatar Peter Eisentraut

Update dummy CREATE ASSERTION grammar

While we are probably still far away from fully implementing
assertions, all patch proposals appear to take issue with the existing
dummy grammar CREATE/DROP ASSERTION productions, so update those a
little bit.  Rename the rule, use any_name instead of name, and remove
some unused code.  Also remove the production for DROP ASSERTION,
since that would most likely be handled via the generic DROP support.

extracted from a patch by Joe Wildish
parent a3d28448
......@@ -259,11 +259,11 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
CreateOpFamilyStmt AlterOpFamilyStmt CreatePLangStmt
CreateSchemaStmt CreateSeqStmt CreateStmt CreateStatsStmt CreateTableSpaceStmt
CreateFdwStmt CreateForeignServerStmt CreateForeignTableStmt
CreateAssertStmt CreateTransformStmt CreateTrigStmt CreateEventTrigStmt
CreateAssertionStmt CreateTransformStmt CreateTrigStmt CreateEventTrigStmt
CreateUserStmt CreateUserMappingStmt CreateRoleStmt CreatePolicyStmt
CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt DiscardStmt DoStmt
DropOpClassStmt DropOpFamilyStmt DropPLangStmt DropStmt
DropAssertStmt DropCastStmt DropRoleStmt
DropCastStmt DropRoleStmt
DropdbStmt DropTableSpaceStmt
DropTransformStmt
DropUserMappingStmt ExplainStmt FetchStmt
......@@ -860,7 +860,7 @@ stmt :
| CopyStmt
| CreateAmStmt
| CreateAsStmt
| CreateAssertStmt
| CreateAssertionStmt
| CreateCastStmt
| CreateConversionStmt
| CreateDomainStmt
......@@ -896,7 +896,6 @@ stmt :
| DeleteStmt
| DiscardStmt
| DoStmt
| DropAssertStmt
| DropCastStmt
| DropOpClassStmt
| DropOpFamilyStmt
......@@ -5639,43 +5638,19 @@ enable_trigger:
/*****************************************************************************
*
* QUERIES :
* QUERY :
* CREATE ASSERTION ...
* DROP ASSERTION ...
*
*****************************************************************************/
CreateAssertStmt:
CREATE ASSERTION name CHECK '(' a_expr ')'
ConstraintAttributeSpec
CreateAssertionStmt:
CREATE ASSERTION any_name CHECK '(' a_expr ')' ConstraintAttributeSpec
{
CreateTrigStmt *n = makeNode(CreateTrigStmt);
n->trigname = $3;
n->args = list_make1($6);
n->isconstraint = true;
processCASbits($8, @8, "ASSERTION",
&n->deferrable, &n->initdeferred, NULL,
NULL, yyscanner);
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("CREATE ASSERTION is not yet implemented")));
$$ = (Node *)n;
}
;
DropAssertStmt:
DROP ASSERTION name opt_drop_behavior
{
DropStmt *n = makeNode(DropStmt);
n->objects = NIL;
n->behavior = $4;
n->removeType = OBJECT_TRIGGER; /* XXX */
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("DROP ASSERTION is not yet implemented")));
$$ = (Node *) n;
$$ = NULL;
}
;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment