Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0b68081
Added full support for sys.database_permissions view
shreyaxr3 Jun 9, 2025
066eca5
Merge remote-tracking branch 'upstream/BABEL_5_X_DEV' into database_p…
shreyaxr3 Jun 9, 2025
7c7b173
Empty-Commit
shreyaxr3 Jun 9, 2025
30168b0
Resolved permission error while granting permission on temp tables
shreyaxr3 Jun 10, 2025
29e5b2f
Fixed single_db testfiles and created before tesfiles for a few files.
shreyaxr3 Jun 10, 2025
06f5391
Fixed Indentation and Formatting
shreyaxr3 Jun 11, 2025
1903cb6
Added before input files 1_GRANT_SCHEMA
shreyaxr3 Jun 11, 2025
46a5cbe
Fixed db_owner test file where grantor was babelfish internal user
shreyaxr3 Jun 12, 2025
cd233ec
Updated metadata inconsistency check to exclude public user role and …
shreyaxr3 Jun 13, 2025
9271fea
Fixed the dummy grantor in upgrade script
shreyaxr3 Jun 13, 2025
6ccf89f
Fixed testfiles
shreyaxr3 Jun 16, 2025
e541ec6
Ignore before files in jdbc_schedule
shreyaxr3 Jun 16, 2025
c7ca46e
Handled role does not exist condition for internal BBF object
shreyaxr3 Jun 16, 2025
eacc339
Fixed sequence of rows in test file
shreyaxr3 Jun 16, 2025
5581341
Replaced the dummy grantor with master_dbo to avoid inconsistency
shreyaxr3 Jun 17, 2025
a022076
Created before files for db_owner test file
shreyaxr3 Jun 17, 2025
feb9fd6
Added heap tuple is valid check
shreyaxr3 Jun 18, 2025
51516a2
Added heap tuple is valid check
shreyaxr3 Jun 18, 2025
a4fdd0b
Added condition to return from hook if object type is other than tabl…
shreyaxr3 Jun 18, 2025
31463d0
Fixed Indentation and other minor changes
shreyaxr3 Jun 23, 2025
12710c8
Passed a common lock inside the functions to avoid race condition
shreyaxr3 Jun 24, 2025
cb17e37
db_permissions
shreyaxr3 Jun 27, 2025
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 contrib/babelfishpg_tsql/sql/ownership.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CREATE TABLE sys.babelfish_schema_permissions (
object_type CHAR(1) NOT NULL COLLATE sys.database_default,
function_args TEXT COLLATE "C",
grantor sys.NVARCHAR(128) COLLATE sys.database_default,
PRIMARY KEY(dbid, schema_name, object_name, grantee, object_type)
PRIMARY KEY(dbid, schema_name, object_name, permission, grantee, object_type, grantor)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is permission a primary key?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Now we store "grant" permissions and "grant with options" permissions in 2 different rows. If there's no primary key on permission if would lead to an error when all the parameters are same except the permission.

);

-- BABELFISH_FUNCTION_EXT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ $$
end;
$$;

-- Babelfish catalog tables are marked system tables and postgres does not normally allow modification on
-- system tables so need to temporarily set allow_system_table_mods to update the primary key of babelfish_function_ext.
SET allow_system_table_mods = ON;
ALTER TABLE sys.babelfish_schema_permissions DROP CONSTRAINT babelfish_schema_permissions_pkey;
ALTER TABLE sys.babelfish_schema_permissions ADD CONSTRAINT babelfish_schema_permissions_pkey PRIMARY KEY(dbid, schema_name, object_name, permission, grantee, object_type, grantor);
RESET allow_system_table_mods;

-- Please add your SQLs here
/*
* Note: These SQL statements may get executed multiple times specially when some features get backpatched.
Expand Down
Loading
Loading