diff --git a/docs/en_US/release_notes_4_29.rst b/docs/en_US/release_notes_4_29.rst index defacae2d..c0f11370e 100644 --- a/docs/en_US/release_notes_4_29.rst +++ b/docs/en_US/release_notes_4_29.rst @@ -28,3 +28,4 @@ Bug fixes | `Issue #5985 `_ - Fixed an issue where the process watcher dialog throws an error for the database server which is already removed. | `Issue #5991 `_ - Ensure that dirty indicator (*) should not be visible when renaming the tabs. | `Issue #5992 `_ - Fixed an issue where escape character is shown when the server/database name has some special characters. +| `Issue #5998 `_ - Fixed an issue where schema diff doesn't show the result of compare if source schema has tables with RLS. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/__init__.py index 29d47bc17..9209321eb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/__init__.py @@ -632,7 +632,8 @@ class RowSecurityView(PGChildNodeView): sql = row_security_policies_utils.get_reverse_engineered_sql( self.conn, schema=schema, table=self.table, scid=scid, - plid=oid, datlastsysoid=self.datlastsysoid, with_header=False) + plid=oid, policy_table_id=tid, + datlastsysoid=self.datlastsysoid, with_header=False) drop_sql = '' if drop_req: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/10_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/10_plus/properties.sql index 6d50c3234..2674c9fdc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/10_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/10_plus/properties.sql @@ -16,7 +16,7 @@ JOIN pg_namespace n ON n.nspname=rw.schemaname JOIN pg_class rel on rel.relname=rw.tablename WHERE {% if plid %} - pl.oid = {{ plid }} and n.oid = {{ scid }} and rel.relfilenode = {{ policy_table_id }}; + pl.oid = {{ plid }} and n.oid = {{ scid }} and rel.oid = {{ policy_table_id }}; {% endif %} {% if tid %} pl.polrelid = {{ tid }}; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/9.5_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/9.5_plus/properties.sql index dcaa60cb9..fde4eeda2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/9.5_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/9.5_plus/properties.sql @@ -15,7 +15,7 @@ JOIN pg_namespace n ON n.nspname=rw.schemaname JOIN pg_class rel on rel.relname=rw.tablename WHERE {% if plid %} - pl.oid = {{ plid }} and n.oid = {{ scid }} and rel.relfilenode = {{ policy_table_id }}; + pl.oid = {{ plid }} and n.oid = {{ scid }} and rel.oid = {{ policy_table_id }}; {% endif %} {% if tid %} pl.polrelid = {{ tid }}; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/default/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/default/properties.sql index dcaa60cb9..fde4eeda2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/default/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/default/properties.sql @@ -15,7 +15,7 @@ JOIN pg_namespace n ON n.nspname=rw.schemaname JOIN pg_class rel on rel.relname=rw.tablename WHERE {% if plid %} - pl.oid = {{ plid }} and n.oid = {{ scid }} and rel.relfilenode = {{ policy_table_id }}; + pl.oid = {{ plid }} and n.oid = {{ scid }} and rel.oid = {{ policy_table_id }}; {% endif %} {% if tid %} pl.polrelid = {{ tid }};