]> granicus.if.org Git - postgresql/commitdiff
Allow NOTIFY/LISTEN/UNLISTEN to only take relation names, not
authorBruce Momjian <bruce@momjian.us>
Mon, 2 Apr 2007 22:20:53 +0000 (22:20 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 2 Apr 2007 22:20:53 +0000 (22:20 +0000)
schema.relation, because the notify code only honors the relation name.
schema.relation will now generate a syntax error.

src/backend/parser/gram.y

index 767129fb924c5c626b02b52430af3cf50e23a5eb..d38393f9865bdaa18e8408139d89c5b3c379bcfe 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.585 2007/04/02 03:49:38 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.586 2007/04/02 22:20:53 momjian Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -4834,27 +4834,33 @@ DropRuleStmt:
  *
  *****************************************************************************/
 
-NotifyStmt: NOTIFY qualified_name
+NotifyStmt: NOTIFY ColId
                                {
                                        NotifyStmt *n = makeNode(NotifyStmt);
-                                       n->relation = $2;
+                                       n->relation = makeNode(RangeVar);
+                                       n->relation->relname = $2;
+                                       n->relation->schemaname = NULL;
                                        $$ = (Node *)n;
                                }
                ;
 
-ListenStmt: LISTEN qualified_name
+ListenStmt: LISTEN ColId
                                {
                                        ListenStmt *n = makeNode(ListenStmt);
-                                       n->relation = $2;
+                                       n->relation = makeNode(RangeVar);
+                                       n->relation->relname = $2;
+                                       n->relation->schemaname = NULL;
                                        $$ = (Node *)n;
                                }
                ;
 
 UnlistenStmt:
-                       UNLISTEN qualified_name
+                       UNLISTEN ColId
                                {
                                        UnlistenStmt *n = makeNode(UnlistenStmt);
-                                       n->relation = $2;
+                                       n->relation = makeNode(RangeVar);
+                                       n->relation->relname = $2;
+                                       n->relation->schemaname = NULL;
                                        $$ = (Node *)n;
                                }
                        | UNLISTEN '*'