Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deparse ALTER TABLE table_name ENABLE TRIGGER ALL syntax errors #222

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/postgres_deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -6330,7 +6330,7 @@ static void deparseAlterTableCmd(StringInfo str, AlterTableCmd *alter_table_cmd,
appendStringInfoString(str, "DISABLE TRIGGER ");
break;
case AT_EnableTrigAll: /* ENABLE TRIGGER ALL */
appendStringInfoString(str, "ENABLE TRIGGER ");
appendStringInfoString(str, "ENABLE TRIGGER ALL ");
break;
case AT_DisableTrigAll: /* DISABLE TRIGGER ALL */
appendStringInfoString(str, "DISABLE TRIGGER ALL ");
Expand Down
6 changes: 6 additions & 0 deletions test/deparse_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@ const char* tests[] = {
"SELECT 1 FROM tbl LIMIT COALESCE($1, $2)",
"SELECT (false AND true) IS FALSE",
"SELECT a = (true IS FALSE)",
"ALTER TABLE a ENABLE TRIGGER b",
"ALTER TABLE a ENABLE TRIGGER ALL",
"ALTER TABLE a ENABLE TRIGGER USER",
"ALTER TABLE a DISABLE TRIGGER b",
"ALTER TABLE a DISABLE TRIGGER ALL",
"ALTER TABLE a DISABLE TRIGGER USER",
};

size_t testsLength = __LINE__ - 4;
Loading