@@ -280,7 +280,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
280
280
AlterSeqStmt AlterCollationStmt AlterSystemStmt CreateDomainStmt AlterDomainStmt
281
281
AlterDatabaseStmt AlterDatabaseSetStmt AlterEventTrigStmt AlterObjectDependsStmt
282
282
AlterEnumStmt AlterExtensionStmt AlterExtensionContentsStmt AlterFdwStmt
283
- AlterGroupStmt
283
+ AlterGroupStmt
284
284
AlterRoleStmt AlterRoleSetStmt AlterOwnerStmt AlterObjectSchemaStmt AlterOperatorStmt
285
285
AlterTableStmt AlterTblSpcStmt AnalyzeStmt AlterOpFamilyStmt AlterTypeStmt
286
286
CreateConversionStmt CreateOpFamilyStmt CallStmt CreateStatsStmt
@@ -305,6 +305,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
305
305
ReindexStmt RemoveFuncStmt ReturnStmt RenameStmt RevokeStmt
306
306
RuleActionStmt RuleActionStmtOrEmpty RuleStmt
307
307
SelectStmt
308
+ NotifyStmt ListenStmt UnlistenStmt
308
309
TransactionStmt TransactionStmtLegacy TruncateStmt
309
310
UpdateStmt
310
311
PreparableStmt
@@ -662,7 +663,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
662
663
%type <integer> OnCommitOption
663
664
664
665
%type <defelt> def_elem reloption_elem old_aggr_elem operator_def_elem
665
- %type <string> Sconst
666
+ %type <string> Sconst notify_payload
666
667
%type <string> ColId ColLabel BareColLabel
667
668
%type <string> NonReservedWord NonReservedWord_or_Sconst name
668
669
%type <list> alter_extension_opt_list create_extension_opt_list
@@ -884,6 +885,7 @@ stmt:
884
885
| AlterObjectDependsStmt
885
886
| AlterObjectSchemaStmt
886
887
| AlterOpFamilyStmt
888
+ | AlterOperatorStmt
887
889
| AlterOwnerStmt
888
890
| AlterPolicyStmt
889
891
| AlterRoleStmt
@@ -918,6 +920,7 @@ stmt:
918
920
| CreateTableSpaceStmt
919
921
| CreateTrigStmt
920
922
| CreateUserStmt
923
+ | DeclareCursorStmt
921
924
| DefineStmt
922
925
| DeleteStmt
923
926
| DoStmt
@@ -934,8 +937,10 @@ stmt:
934
937
| FetchStmt
935
938
| GrantStmt
936
939
| IndexStmt
937
- | InsertStmt
940
+ | InsertStmt
941
+ | ListenStmt
938
942
| LockStmt
943
+ | NotifyStmt
939
944
| PrepareStmt
940
945
| ReindexStmt
941
946
| RemoveFuncStmt
@@ -946,6 +951,7 @@ stmt:
946
951
| TransactionStmt
947
952
| TransactionStmtLegacy
948
953
| TruncateStmt
954
+ | UnlistenStmt
949
955
| UseGraphStmt
950
956
| UpdateStmt
951
957
| VacuumStmt
@@ -1612,7 +1618,7 @@ table_ref: relation_expr opt_alias_clause
1612
1618
n->coldeflist = lsecond($3 );
1613
1619
$$ = (Node *) n;
1614
1620
}
1615
- /* | xmltable opt_alias_clause TODO
1621
+ | xmltable opt_alias_clause
1616
1622
{
1617
1623
RangeTableFunc *n = (RangeTableFunc *) $1 ;
1618
1624
n->alias = $2 ;
@@ -1624,7 +1630,7 @@ table_ref: relation_expr opt_alias_clause
1624
1630
n->lateral = true ;
1625
1631
n->alias = $3 ;
1626
1632
$$ = (Node *) n;
1627
- }*/
1633
+ }
1628
1634
| select_with_parens opt_alias_clause
1629
1635
{
1630
1636
RangeSubselect *n = makeNode(RangeSubselect);
@@ -2020,14 +2026,14 @@ where_clause:
2020
2026
/* variant for UPDATE and DELETE */
2021
2027
where_or_current_clause :
2022
2028
WHERE a_expr { $$ = $2 ; }
2023
- /* | WHERE CURRENT_P OF cursor_name TODO
2029
+ | WHERE CURRENT OF cursor_name
2024
2030
{
2025
2031
CurrentOfExpr *n = makeNode(CurrentOfExpr);
2026
2032
2027
2033
n->cursor_name = $4 ;
2028
2034
n->cursor_param = 0 ;
2029
2035
$$ = (Node *) n;
2030
- }*/
2036
+ }
2031
2037
| /* EMPTY*/ { $$ = NULL ; }
2032
2038
;
2033
2039
@@ -2140,26 +2146,23 @@ xmltable_column_el:
2140
2146
if (fc->coldefexpr != NULL )
2141
2147
ereport (ERROR,
2142
2148
(errcode (ERRCODE_SYNTAX_ERROR),
2143
- errmsg (" only one DEFAULT value is allowed" ),
2144
- parser_errposition (defel->location )));
2149
+ errmsg (" only one DEFAULT value is allowed" )));
2145
2150
fc->coldefexpr = defel->arg ;
2146
2151
}
2147
2152
else if (strcmp (defel->defname , " path" ) == 0 )
2148
2153
{
2149
2154
if (fc->colexpr != NULL )
2150
2155
ereport (ERROR,
2151
2156
(errcode (ERRCODE_SYNTAX_ERROR),
2152
- errmsg (" only one PATH value per column is allowed" ),
2153
- parser_errposition (defel->location )));
2157
+ errmsg (" only one PATH value per column is allowed" )));
2154
2158
fc->colexpr = defel->arg ;
2155
2159
}
2156
2160
else if (strcmp (defel->defname , " is_not_null" ) == 0 )
2157
2161
{
2158
2162
if (nullability_seen)
2159
2163
ereport (ERROR,
2160
2164
(errcode (ERRCODE_SYNTAX_ERROR),
2161
- errmsg (" conflicting or redundant NULL / NOT NULL declarations for column \" %s\" " , fc->colname ),
2162
- parser_errposition (defel->location )));
2165
+ errmsg (" conflicting or redundant NULL / NOT NULL declarations for column \" %s\" " , fc->colname )));
2163
2166
fc->is_not_null = intVal (defel->arg );
2164
2167
nullability_seen = true ;
2165
2168
}
@@ -2168,8 +2171,7 @@ xmltable_column_el:
2168
2171
ereport (ERROR,
2169
2172
(errcode (ERRCODE_SYNTAX_ERROR),
2170
2173
errmsg (" unrecognized column option \" %s\" " ,
2171
- defel->defname ),
2172
- parser_errposition (defel->location )));
2174
+ defel->defname )));
2173
2175
}
2174
2176
}
2175
2177
$$ = (Node *) fc;
@@ -6527,16 +6529,16 @@ object_type_any_name:
6527
6529
TABLE { $$ = OBJECT_TABLE; }
6528
6530
| SEQUENCE { $$ = OBJECT_SEQUENCE; }
6529
6531
| VIEW { $$ = OBJECT_VIEW; }
6530
- // | MATERIALIZED VIEW { $$ = OBJECT_MATVIEW; }
6532
+ | MATERIALIZED VIEW { $$ = OBJECT_MATVIEW; }
6531
6533
| INDEX { $$ = OBJECT_INDEX; }
6532
6534
| FOREIGN TABLE { $$ = OBJECT_FOREIGN_TABLE; }
6533
- // | COLLATION { $$ = OBJECT_COLLATION; }
6534
- // | CONVERSION_P { $$ = OBJECT_CONVERSION; }
6535
- // | STATISTICS { $$ = OBJECT_STATISTIC_EXT; }
6536
- /* | TEXT_P SEARCH PARSER { $$ = OBJECT_TSPARSER; }
6535
+ | COLLATION { $$ = OBJECT_COLLATION; }
6536
+ | CONVERSION_P { $$ = OBJECT_CONVERSION; }
6537
+ | STATISTICS { $$ = OBJECT_STATISTIC_EXT; }
6538
+ | TEXT_P SEARCH PARSER { $$ = OBJECT_TSPARSER; }
6537
6539
| TEXT_P SEARCH DICTIONARY { $$ = OBJECT_TSDICTIONARY; }
6538
6540
| TEXT_P SEARCH TEMPLATE { $$ = OBJECT_TSTEMPLATE; }
6539
- | TEXT_P SEARCH CONFIGURATION { $$ = OBJECT_TSCONFIGURATION; }*/
6541
+ | TEXT_P SEARCH CONFIGURATION { $$ = OBJECT_TSCONFIGURATION; }
6540
6542
;
6541
6543
6542
6544
/*
@@ -7691,6 +7693,53 @@ table_func_column_list:
7691
7693
}
7692
7694
;
7693
7695
7696
+
7697
+ /* ****************************************************************************
7698
+ *
7699
+ * QUERY:
7700
+ * NOTIFY <identifier> can appear both in rule bodies and
7701
+ * as a query-level command
7702
+ *
7703
+ *****************************************************************************/
7704
+
7705
+ NotifyStmt : NOTIFY ColId notify_payload
7706
+ {
7707
+ NotifyStmt *n = makeNode(NotifyStmt);
7708
+ n->conditionname = $2 ;
7709
+ n->payload = $3 ;
7710
+ $$ = (Node *)n;
7711
+ }
7712
+ ;
7713
+
7714
+ notify_payload :
7715
+ ' ,' Sconst { $$ = $2 ; }
7716
+ | /* EMPTY*/ { $$ = NULL ; }
7717
+ ;
7718
+
7719
+ ListenStmt : LISTEN ColId
7720
+ {
7721
+ ListenStmt *n = makeNode(ListenStmt);
7722
+ n->conditionname = $2 ;
7723
+ $$ = (Node *)n;
7724
+ }
7725
+ ;
7726
+
7727
+ UnlistenStmt :
7728
+ UNLISTEN ColId
7729
+ {
7730
+ UnlistenStmt *n = makeNode(UnlistenStmt);
7731
+ n->conditionname = $2 ;
7732
+ $$ = (Node *)n;
7733
+ }
7734
+ | UNLISTEN ' *'
7735
+ {
7736
+ UnlistenStmt *n = makeNode(UnlistenStmt);
7737
+ n->conditionname = NULL ;
7738
+ $$ = (Node *)n;
7739
+ }
7740
+ ;
7741
+
7742
+
7694
7743
/* ****************************************************************************
7695
7744
*
7696
7745
* Transactions:
@@ -7904,7 +7953,7 @@ RuleActionStmt:
7904
7953
| InsertStmt
7905
7954
| UpdateStmt
7906
7955
| DeleteStmt
7907
- // | NotifyStmt TODO
7956
+ | NotifyStmt
7908
7957
;
7909
7958
7910
7959
RuleActionStmtOrEmpty :
@@ -9701,7 +9750,7 @@ AlterObjectSchemaStmt:
9701
9750
*****************************************************************************/
9702
9751
9703
9752
AlterOperatorStmt :
9704
- ALTER OPERATOR operator_with_argtypes SET ' (' operator_def_list ' )'
9753
+ ALTER OPERATOR_P operator_with_argtypes SET ' (' operator_def_list ' )'
9705
9754
{
9706
9755
AlterOperatorStmt *n = makeNode(AlterOperatorStmt);
9707
9756
n->opername = $3 ;
0 commit comments