Skip to content

Commit

Permalink
Update comment and upgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
lohia-shalini committed Jan 6, 2025
1 parent 2841820 commit 76175ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions contrib/babelfishpg_tsql/sql/ownership.sql
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ AS 'babelfishpg_tsql', 'bbf_is_role_member' LANGUAGE C;
CREATE OR REPLACE VIEW sys.database_principals AS
SELECT
CAST(Ext.orig_username AS SYS.SYSNAME) AS name,
-- PG reserves these oid > 16383 AND oid < 16400 for rds roles like rds_iam etc.
-- We need to make sure that any user defined role doesn't get assigned oid > 16383 AND oid < 16400.
-- Any change here in the oid should be reflected in sys.database_role_members view as well.
CAST(
CASE Ext.orig_username
WHEN 'db_owner' THEN 16384
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,11 @@ AS 'babelfishpg_tsql', 'bbf_is_role_member' LANGUAGE C;
CREATE OR REPLACE VIEW sys.database_principals AS
SELECT
CAST(Ext.orig_username AS SYS.SYSNAME) AS name,
-- PG reserves these oid > 16383 AND oid < 16400 for rds roles like rds_iam etc.
-- We need to make sure that any user defined role doesn't get assigned oid > 16383 AND oid < 16400.
-- Any change here in the oid should be reflected in sys.database_role_members view as well.
CAST(
CASE Ext.orig_username
WHEN 'dbo' THEN 1
WHEN 'guest' THEN 2
WHEN 'db_owner' THEN 16384
WHEN 'db_accessadmin' THEN 16385
WHEN 'db_securityadmin' THEN 16386
Expand Down

0 comments on commit 76175ac

Please sign in to comment.