babelfish-for-postgresql / babelfish_extensions

Babelfish for PostgreSQL provides the capability for PostgreSQL to work with applications written for Microsoft SQL Server. Babelfish understands the SQL Server wire-protocol and T-SQL, the Microsoft SQL Server query and procedural language, so you don’t have to switch database drivers or rewrite all of your application queries.
https://babelfishpg.org/
Apache License 2.0
277 stars 93 forks source link

[OSS-ONLY] Execute CREATE/GRANT ROLE statements using bbf_role_admin during restore #3135

Closed rishabhtanwar29 closed 5 days ago

rishabhtanwar29 commented 5 days ago

Description

Execute CREATE/GRANT ROLE statements using bbf_role_admin during restore so that bbf_role_admin becomes the admin/GRANTOR. We will do this only if the current is superuser since only superuser is allowed to perform dump/restore. Note that no additional permission checks are needed as superusers can anyway perform this action.

Additionally, update GRATOR of grants from previous versions from BOOTSTRAP_SUPERUSER to bbf_role_admin.

Task: BABEL-5309 Signed-off-by: Rishabh Tanwar ritanwar@amazon.com

Test Scenarios Covered

Check List

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 commented 5 days ago

Pull Request Test Coverage Report for Build 11930577485

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/pl_handler.c 2 28 7.14%
<!-- Total: 2 28 7.14% -->
Totals Coverage Status
Change from base Build 11917911283: -0.03%
Covered Lines: 45763
Relevant Lines: 61391

💛 - Coveralls