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

Add Dialect check for ALTER TABLE ENABLE/DISABLE TRIG ALL #544

Conversation

shah-nirmit
Copy link
Contributor

@shah-nirmit shah-nirmit commented Mar 3, 2025

Description

To Disable FKEY Action Triggers we need superuser privileges code reference , But for tsql we only need to disable user defined triggers , You can see the difference between ALL vs USER Enable/Disable here . We should specify the AT_[Disable/Enable]TrigUser command for ENABLE/DISABLE TRIGGER ALL Syntax instead of AT_[Disable/Enable]TrigAll
Extension PR babelfish-for-postgresql/babelfish_extensions#3547

Issues Resolved

BABEL-5645
Signed-off-by: Nirmit Shah nirmisha@amazon.com

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the PostgreSQL license, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Nirmit Shah <nirmisha@amazon.com>
Comment on lines +2824 to +2831
if(sql_dialect == SQL_DIALECT_TSQL)
{
n->subtype = AT_DisableTrigUser;
}
else
{
n->subtype = AT_DisableTrigAll;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re writing this in Antlr would be more preferable if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, will close this , and rewrite in ANTLR

@shah-nirmit shah-nirmit closed this Mar 5, 2025
@shah-nirmit shah-nirmit deleted the 5645-5x branch March 5, 2025 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants