aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-16 22:34:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-16 22:34:57 +0000
commitd1e027221d0243b7b57eabb0e482923dd7d1c8eb (patch)
tree034988b788248c88fad3b73fb4d8d1afff2dd509 /src/backend/parser
parentfc5173ad514a216dc93bc190dbba3751024a257d (diff)
downloadpostgresql-d1e027221d0243b7b57eabb0e482923dd7d1c8eb.tar.gz
postgresql-d1e027221d0243b7b57eabb0e482923dd7d1c8eb.zip
Replace the pg_listener-based LISTEN/NOTIFY mechanism with an in-memory queue.
In addition, add support for a "payload" string to be passed along with each notify event. This implementation should be significantly more efficient than the old one, and is also more compatible with Hot Standby usage. There is not yet any facility for HS slaves to receive notifications generated on the master, although such a thing is possible in future. Joachim Wieland, reviewed by Jeff Davis; also hacked on by me.
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index da70ee089c5..235a7001adf 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.708 2010/02/12 17:33:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.709 2010/02/16 22:34:49 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -400,7 +400,7 @@ static TypeName *TableFuncTypeName(List *columns);
%type <ival> Iconst SignedIconst
%type <list> Iconst_list
-%type <str> Sconst comment_text
+%type <str> Sconst comment_text notify_payload
%type <str> RoleId opt_granted_by opt_boolean ColId_or_Sconst
%type <list> var_list
%type <str> ColId ColLabel var_name type_function_name param_name
@@ -6123,14 +6123,20 @@ DropRuleStmt:
*
*****************************************************************************/
-NotifyStmt: NOTIFY ColId
+NotifyStmt: NOTIFY ColId notify_payload
{
NotifyStmt *n = makeNode(NotifyStmt);
n->conditionname = $2;
+ n->payload = $3;
$$ = (Node *)n;
}
;
+notify_payload:
+ ',' Sconst { $$ = $2; }
+ | /*EMPTY*/ { $$ = NULL; }
+ ;
+
ListenStmt: LISTEN ColId
{
ListenStmt *n = makeNode(ListenStmt);