diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-03-03 22:14:58 -0500 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-03-03 23:29:13 -0500 |
commit | 347302730dc3092143ccbc1c29b47ac3354f924b (patch) | |
tree | 74cc263bd0bc0c3e23ba6c304b4dba77f004edb4 /src | |
parent | 1309375e706440e1e2fe2a5bb74effbc639261ef (diff) | |
download | postgresql-347302730dc3092143ccbc1c29b47ac3354f924b.tar.gz postgresql-347302730dc3092143ccbc1c29b47ac3354f924b.zip |
Fix parsing of DROP SUBSCRIPTION ... DROP SLOT
It didn't actually parse before.
Reported-by: Masahiko Sawada <sawada.mshk@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/parser/gram.y | 10 | ||||
-rw-r--r-- | src/test/subscription/t/001_rep_changes.pl | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 9713b442232..29fde33b2b5 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -9196,11 +9196,13 @@ DropSubscriptionStmt: DROP SUBSCRIPTION name opt_drop_slot ; opt_drop_slot: - IDENT SLOT + DROP SLOT { - if (strcmp($1, "drop") == 0) - $$ = TRUE; - else if (strcmp($1, "nodrop") == 0) + $$ = TRUE; + } + | IDENT SLOT + { + if (strcmp($1, "nodrop") == 0) $$ = FALSE; else ereport(ERROR, diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl index fffb3c51bef..b81028aed14 100644 --- a/src/test/subscription/t/001_rep_changes.pl +++ b/src/test/subscription/t/001_rep_changes.pl @@ -179,7 +179,7 @@ $node_publisher->poll_query_until('postgres', or die "Timed out while waiting for apply to restart"; # check all the cleanup -$node_subscriber->safe_psql('postgres', "DROP SUBSCRIPTION tap_sub_renamed"); +$node_subscriber->safe_psql('postgres', "DROP SUBSCRIPTION tap_sub_renamed DROP SLOT"); $result = $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM pg_subscription"); |