diff options
| author | Bruce Momjian | 1998-01-22 23:05:18 +0000 |
|---|---|---|
| committer | Bruce Momjian | 1998-01-22 23:05:18 +0000 |
| commit | 7015dfef4babdc2cce655baf24c1b2b741864a60 (patch) | |
| tree | f7bf6fd264b9d502c9f1334c3e62c946766476f2 /src/backend | |
| parent | 0fd8d6018587e5f8162f96e59c693dca7b8fae82 (diff) | |
Add LOCK command as DELETE FROM ... WHERE false.
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/parser/gram.y | 28 | ||||
| -rw-r--r-- | src/backend/parser/keywords.c | 3 |
2 files changed, 27 insertions, 4 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index e259fbeca82..fae67cb8baf 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.95 1998/01/20 05:04:07 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.96 1998/01/22 23:04:52 momjian Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -116,7 +116,7 @@ Oid param_type(int t); /* used in parse_expr.c */ CopyStmt, CreateStmt, CreateAsStmt, CreateSeqStmt, DefineStmt, DestroyStmt, ExtendStmt, FetchStmt, GrantStmt, CreateTrigStmt, DropTrigStmt, CreatePLangStmt, DropPLangStmt, - IndexStmt, ListenStmt, OptimizableStmt, + IndexStmt, ListenStmt, LockStmt, OptimizableStmt, ProcedureStmt, RecipeStmt, RemoveAggrStmt, RemoveOperStmt, RemoveFuncStmt, RemoveStmt, RenameStmt, RevokeStmt, RuleStmt, TransactionStmt, ViewStmt, LoadStmt, @@ -276,7 +276,7 @@ Oid param_type(int t); /* used in parse_expr.c */ DATABASE, DELIMITERS, DO, EXPLAIN, EXTEND, FORWARD, FUNCTION, HANDLER, INDEX, INHERITS, INSTEAD, ISNULL, - LANCOMPILER, LISTEN, LOAD, LOCATION, MERGE, MOVE, + LANCOMPILER, LISTEN, LOAD, LOCK_P, LOCATION, MERGE, MOVE, NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL, RECIPE, RENAME, REPLACE, RESET, RETURNS, RULE, SEQUENCE, SETOF, SHOW, STDIN, STDOUT, TRUSTED, @@ -364,6 +364,7 @@ stmt : AddAttrStmt | GrantStmt | IndexStmt | ListenStmt + | LockStmt | ProcedureStmt | RecipeStmt | RemoveAggrStmt @@ -2210,6 +2211,27 @@ DeleteStmt: DELETE FROM relation_name } ; +/* + * Total hack to just lock a table inside a transaction. + * Is it worth making this a separate command, with + * its own node type and file. I don't think so. bjm 1998/1/22 + */ +LockStmt: LOCK_P relation_name + { + DeleteStmt *n = makeNode(DeleteStmt); + A_Const *c = makeNode(A_Const); + + c->val.type = T_String; + c->val.val.str = "f"; + c->typename = makeNode(TypeName); + c->typename->name = xlateSqlType("bool"); + + n->relname = $2; + n->whereClause = c; + $$ = (Node *)n; + } + ; + /***************************************************************************** * diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c index 904d71a43f9..71ca0817dd2 100644 --- a/src/backend/parser/keywords.c +++ b/src/backend/parser/keywords.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.31 1998/01/20 05:04:09 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.32 1998/01/22 23:04:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -127,6 +127,7 @@ static ScanKeyword ScanKeywords[] = { {"load", LOAD}, {"local", LOCAL}, {"location", LOCATION}, + {"lock", LOCK_P}, {"match", MATCH}, {"merge", MERGE}, {"minute", MINUTE_P}, |
