Support for weak binding views to allow dropping of underlying objects#585
Merged
forestkeeper merged 20 commits intoJul 11, 2025
Merged
Conversation
added 5 commits
June 5, 2025 17:18
Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
forestkeeper
reviewed
Jun 5, 2025
added 4 commits
June 9, 2025 19:12
views Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
R4hul04
marked this pull request as ready for review
June 16, 2025 19:05
added 2 commits
June 17, 2025 17:49
Signed-off-by: Rahul Parande <rparande@amazon.com>
instead added it's declaration at the top to access the function Signed-off-by: Rahul Parande <rparande@amazon.com>
tanscorpio7
requested changes
Jun 17, 2025
kuntalghosh
previously requested changes
Jun 18, 2025
added 7 commits
June 18, 2025 19:55
InvokeObjectDropHook. 2. Removed check_view_dependencies_hook from view.c and used existing post_parse_analyze_hook. 3. Renamed view_repair_hook to pre_QueryRewrite_hook Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
…Hook Signed-off-by: Rahul Parande <rparande@amazon.com>
as special call for dependency check during function drop Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
reuse the logic for weak binding view repair Signed-off-by: Rahul Parande <rparande@amazon.com>
forestkeeper
previously approved these changes
Jul 2, 2025
tanscorpio7
requested changes
Jul 3, 2025
babelfish view repair Signed-off-by: Rahul Parande <rparande@amazon.com>
Signed-off-by: Rahul Parande <rparande@amazon.com>
tanscorpio7
approved these changes
Jul 11, 2025
forestkeeper
approved these changes
Jul 11, 2025
forestkeeper
merged commit Jul 11, 2025
cd94e1f
into
babelfish-for-postgresql:BABEL_5_X_DEV__PG_17_X
2 checks passed
1 task
forestkeeper
pushed a commit
that referenced
this pull request
Jul 14, 2025
#599) Cherry picked commit from: #585 Description This PR introduces improvements to Babelfish's view handling, focusing on weak binding views. The changes enable more SQL Server-compatible behavior for view dependencies. This PR introduces the following changes: 1. Added hook in DROP codepath to allow dropping underlying objects (tables, functions, views) referenced by weak binding views without errors, while maintaining the view structure 2. Implemented a view repair mechanism hook that automatically fixes broken views when their referenced objects are recreated, eliminating the need for manual view recreation Implementation Details 1. Added a new flags BBF_VIEW_DEF_FLAG_IS_BROKEN to track views with missing dependencies and BBF_VIEW_DEF_FLAG_IS_WEAK_VIEW to identify view's schemabinding property in babelfish_view_def catalog 2. Implemented hooks in object drop operations to detect and mark dependent views as broken 3. Added preQueryRewrtie hook for view repair mechanism that activates when a broken view is accessed during the rewriting 4. Wrapper function for DefineVirtualRelation Issues Resolved: BABEL-1660 Signed-off-by: Rahul Parande rparande@amazon.com
R4hul04
added a commit
to amazon-aurora/postgresql_modified_for_babelfish
that referenced
this pull request
Jul 14, 2025
babelfish-for-postgresql#585) This PR introduces improvements to Babelfish's view handling, focusing on weak binding views. The changes enable more SQL Server-compatible behavior for view dependencies. This PR introduces the following changes: Added hook in DROP codepath to allow dropping underlying objects (tables, functions, views) referenced by weak binding views without errors, while maintaining the view structure Implemented a view repair mechanism hook that automatically fixes broken views when their referenced objects are recreated, eliminating the need for manual view recreation Implementation Details Added a new flags BBF_VIEW_DEF_FLAG_IS_BROKEN to track views with missing dependencies and BBF_VIEW_DEF_FLAG_IS_WEAK_VIEW to identify view's schemabinding property in babelfish_view_def catalog Implemented hooks in object drop operations to detect and mark dependent views as broken Added preQueryRewrtie hook for view repair mechanism that activates when a broken view is accessed during the rewriting Issues Resolved BABEL-1660 Signed-off-by: Rahul Parande <rparande@amazon.com>
1 task
R4hul04
added a commit
to amazon-aurora/postgresql_modified_for_babelfish
that referenced
this pull request
Jul 15, 2025
babelfish-for-postgresql#585) This PR introduces improvements to Babelfish's view handling, focusing on weak binding views. The changes enable more SQL Server-compatible behavior for view dependencies. This PR introduces the following changes: Added hook in DROP codepath to allow dropping underlying objects (tables, functions, views) referenced by weak binding views without errors, while maintaining the view structure Implemented a view repair mechanism hook that automatically fixes broken views when their referenced objects are recreated, eliminating the need for manual view recreation Implementation Details Added a new flags BBF_VIEW_DEF_FLAG_IS_BROKEN to track views with missing dependencies and BBF_VIEW_DEF_FLAG_IS_WEAK_VIEW to identify view's schemabinding property in babelfish_view_def catalog Implemented hooks in object drop operations to detect and mark dependent views as broken Added preQueryRewrtie hook for view repair mechanism that activates when a broken view is accessed during the rewriting Issues Resolved BABEL-1660 Signed-off-by: Rahul Parande <rparande@amazon.com>
1 task
jsudrik
pushed a commit
that referenced
this pull request
Jul 15, 2025
#585) (#602) This PR introduces improvements to Babelfish's view handling, focusing on weak binding views. The changes enable more SQL Server-compatible behavior for view dependencies. This PR introduces the following changes: Added hook in DROP codepath to allow dropping underlying objects (tables, functions, views) referenced by weak binding views without errors, while maintaining the view structure Implemented a view repair mechanism hook that automatically fixes broken views when their referenced objects are recreated, eliminating the need for manual view recreation Implementation Details Added a new flags BBF_VIEW_DEF_FLAG_IS_BROKEN to track views with missing dependencies and BBF_VIEW_DEF_FLAG_IS_WEAK_VIEW to identify view's schemabinding property in babelfish_view_def catalog Implemented hooks in object drop operations to detect and mark dependent views as broken Added preQueryRewrtie hook for view repair mechanism that activates when a broken view is accessed during the rewriting Issues Resolved BABEL-1660 Signed-off-by: Rahul Parande <rparande@amazon.com>
jsudrik
pushed a commit
that referenced
this pull request
Jul 15, 2025
#585) (#601) This PR introduces improvements to Babelfish's view handling, focusing on weak binding views. The changes enable more SQL Server-compatible behavior for view dependencies. This PR introduces the following changes: Added hook in DROP codepath to allow dropping underlying objects (tables, functions, views) referenced by weak binding views without errors, while maintaining the view structure Implemented a view repair mechanism hook that automatically fixes broken views when their referenced objects are recreated, eliminating the need for manual view recreation Implementation Details Added a new flags BBF_VIEW_DEF_FLAG_IS_BROKEN to track views with missing dependencies and BBF_VIEW_DEF_FLAG_IS_WEAK_VIEW to identify view's schemabinding property in babelfish_view_def catalog Implemented hooks in object drop operations to detect and mark dependent views as broken Added preQueryRewrtie hook for view repair mechanism that activates when a broken view is accessed during the rewriting Issues Resolved BABEL-1660 Signed-off-by: Rahul Parande <rparande@amazon.com>
shalinilohia50
pushed a commit
to amazon-aurora/postgresql_modified_for_babelfish
that referenced
this pull request
Sep 20, 2025
babelfish-for-postgresql#585) This PR introduces improvements to Babelfish's view handling, focusing on weak binding views. The changes enable more SQL Server-compatible behavior for view dependencies. This PR introduces the following changes: Added hook in DROP codepath to allow dropping underlying objects (tables, functions, views) referenced by weak binding views without errors, while maintaining the view structure Implemented a view repair mechanism hook that automatically fixes broken views when their referenced objects are recreated, eliminating the need for manual view recreation Implementation Details Added a new flags BBF_VIEW_DEF_FLAG_IS_BROKEN to track views with missing dependencies and BBF_VIEW_DEF_FLAG_IS_WEAK_VIEW to identify view's schemabinding property in babelfish_view_def catalog Implemented hooks in object drop operations to detect and mark dependent views as broken Added preQueryRewrtie hook for view repair mechanism that activates when a broken view is accessed during the rewriting Issues Resolved BABEL-1660 Signed-off-by: Rahul Parande <rparande@amazon.com> (cherry picked from commit cd94e1f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces improvements to Babelfish's view handling, focusing on weak binding views. The changes enable more SQL Server-compatible behavior for view dependencies.
This PR introduces the following changes:
Implementation Details
BBF_VIEW_DEF_FLAG_IS_BROKENto track views with missing dependencies andBBF_VIEW_DEF_FLAG_IS_WEAK_VIEWto identify view's schemabinding property inbabelfish_view_defcatalogIssues Resolved
BABEL-1660
Signed-off-by: Rahul Parande rparande@amazon.com
Check List
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.