*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.25 1998/08/25 15:04:23 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.26 1998/08/25 21:36:53 scrappy Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
CopyStmt, CreateStmt, CreateAsStmt, CreateSeqStmt, DefineStmt, DestroyStmt,
ExtendStmt, FetchStmt, GrantStmt, CreateTrigStmt, DropTrigStmt,
CreatePLangStmt, DropPLangStmt,
- IndexStmt, ListenStmt, LockStmt, OptimizableStmt,
+ IndexStmt, ListenStmt, UnlistenStmt, LockStmt, OptimizableStmt,
ProcedureStmt, RecipeStmt, RemoveAggrStmt, RemoveOperStmt,
RemoveFuncStmt, RemoveStmt,
RenameStmt, RevokeStmt, RuleStmt, TransactionStmt, ViewStmt, LoadStmt,
| GrantStmt
| IndexStmt
| ListenStmt
+ | UnlistenStmt
| LockStmt
| ProcedureStmt
| RecipeStmt
}
;
+UnlistenStmt: UNLISTEN relation_name
+ {
+ UnlistenStmt *n = makeNode(UnlistenStmt);
+ n->relname = $2;
+ $$ = (Node *)n;
+ }
+;
+
/*****************************************************************************
*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.41 1998/08/25 15:04:24 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.42 1998/08/25 21:36:55 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
{"type", TYPE_P},
{"union", UNION},
{"unique", UNIQUE},
+ {"unlisten", UNLISTEN},
{"until", UNTIL},
{"update", UPDATE},
{"user", USER},
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.47 1998/08/25 21:24:09 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.48 1998/08/25 21:36:56 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
}
break;
+ case T_UnlistenStmt:
+ {
+ UnlistenStmt *stmt = (UnlistenStmt *) parsetree;
+
+ PS_SET_STATUS( commandTag = "UNLISTEN" );
+ CHECK_IF_ABORTED();
+
+ Async_Unlisten(stmt->relname, MyProcPid);
+ }
+ break;
+
/*
* ******************************** dynamic loader ********************************
*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: psqlHelp.h,v 1.49 1998/07/26 01:18:09 momjian Exp $
+ * $Id: psqlHelp.h,v 1.50 1998/08/25 21:36:58 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
\t[HAVING having_clause]\n\
\t[UNION [ALL] SELECT ...];"},
{"listen",
- "listen for notification on a relation",
+ "listen for notification on a relation name",
"\
-\tLISTEN class_name"},
+\tLISTEN class_name|\"name\""},
{"load",
"dynamically load a module",
"\
"\
\tSHOW DateStyle|GEQO|R_PLANS"},
#endif
- {"UPDATE",
+ {"unlisten",
+ "unlisten for notification on a relation name",
+ "\
+\tUNLISTEN class_name|\"name\"|\"*\""},
+ {"update",
"update tuples",
"\
\tUPDATE class_name SET attr1 = expr1, ...attrN = exprN\n\
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: async.h,v 1.7 1997/09/08 02:35:37 momjian Exp $
+ * $Id: async.h,v 1.8 1998/08/25 21:37:00 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
extern void Async_NotifyAtCommit(void);
extern void Async_NotifyAtAbort(void);
extern void Async_Listen(char *relname, int pid);
+extern void Async_Unlisten(char *relname, int pid);
extern GlobalMemory notifyContext;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodes.h,v 1.27 1998/08/18 00:49:01 scrappy Exp $
+ * $Id: nodes.h,v 1.28 1998/08/25 21:37:02 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
T_RuleStmt,
T_NotifyStmt,
T_ListenStmt,
+ T_UnlistenStmt,
T_TransactionStmt,
T_ViewStmt,
T_LoadStmt,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.56 1998/08/25 15:09:31 thomas Exp $
+ * $Id: parsenodes.h,v 1.57 1998/08/25 21:37:04 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
char *relname; /* relation to listen on */
} ListenStmt;
+/* ----------------------
+ * Unlisten Statement
+ * ----------------------
+ */
+typedef struct UnlistenStmt
+{
+ NodeTag type;
+ char *relname; /* relation to unlisten on */
+} UnlistenStmt;
+
/* ----------------------
* {Begin|Abort|End} Transaction Statement
* ----------------------
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.2 1998/05/18 16:05:00 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.3 1998/08/25 21:37:06 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
{"type", TYPE_P},
{"union", UNION},
{"unique", UNIQUE},
+ {"unlisten", UNLISTEN},
{"until", UNTIL},
{"update", UPDATE},
{"user", USER},
DATABASE, DELIMITERS, DO, EACH, EXPLAIN, EXTEND,
FORWARD, FUNCTION, HANDLER,
INCREMENT, INDEX, INHERITS, INSTEAD, ISNULL,
- LANCOMPILER, LISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,
+ LANCOMPILER, LISTEN, UNLISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,
NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,
RECIPE, RENAME, RESET, RETURNS, ROW, RULE,
SEQUENCE, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED,
| GrantStmt { output_statement($1, 0); }
| IndexStmt { output_statement($1, 0); }
| ListenStmt { output_statement($1, 0); }
+ | UnlistenStmt { output_statement($1, 0); }
| LockStmt { output_statement($1, 0); }
| ProcedureStmt { output_statement($1, 0); }
| RecipeStmt { output_statement($1, 0); }
}
;
+UnlistenStmt: UNLISTEN relation_name
+ {
+ $$ = cat2_str(make1_str("unlisten"), $2);
+ }
+;
+
/*****************************************************************************
*
* Transactions: