Skip to content

Conversation

@R4hul04
Copy link
Contributor

@R4hul04 R4hul04 commented Jul 22, 2025

This PR modifies how we identify T-SQL ALTER VIEW and CREATE OR ALTER VIEW operations. Instead of using a custom field added to the PostgreSQL ViewStmt structure, we now use the standard options list mechanism instead

This PR includes following changes:

  • Updated grammar rules to add a marker in the options list
  • Added logic to check for this option in alter view operation handling

Engine PR - babelfish-for-postgresql/postgresql_modified_for_babelfish#607

Issues Resolved

BABEL-5939

Signed off by: Rahul Parande [email protected]

Test Scenarios Covered

  • Use case based -

  • Boundary conditions -

  • Arbitrary inputs -

  • Negative test cases -

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

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 Apache 2.0 and PostgreSQL licenses, 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.

@coveralls
Copy link
Collaborator

coveralls commented Jul 22, 2025

Pull Request Test Coverage Report for Build 16763699635

Details

  • 12 of 12 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 76.074%

Totals Coverage Status
Change from base Build 16742859777: 0.005%
Covered Lines: 49985
Relevant Lines: 65706

💛 - Coveralls

Comment on lines 7347 to 7359
if (stmt != NULL)
{
foreach(option, stmt->options)
{
DefElem *def = (DefElem *) lfirst(option);

if (strcmp(def->defname, "tsql_alter_view_op") == 0)
{
tsql_alter_view_op = true;
break;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we instead convert ViewStmt *stmt in function signature to a boolean is_alter_view
Also is Relation depRel being used by anyone ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the observation. depRel isn't used anywhere, I might have missed to remove it. Also changed the argument to bool instead of Viewstmt

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.

3 participants