Fixed an issue where schema diff doesn't show the result of compare if source schema has tables with RLS. Fixes #5998

This commit is contained in:
Akshay Joshi 2020-12-01 13:46:19 +05:30
parent 783b7516a7
commit 64e6570f00
5 changed files with 6 additions and 4 deletions

View File

@ -28,3 +28,4 @@ Bug fixes
| `Issue #5985 <https://redmine.postgresql.org/issues/5985>`_ - Fixed an issue where the process watcher dialog throws an error for the database server which is already removed.
| `Issue #5991 <https://redmine.postgresql.org/issues/5991>`_ - Ensure that dirty indicator (*) should not be visible when renaming the tabs.
| `Issue #5992 <https://redmine.postgresql.org/issues/5992>`_ - Fixed an issue where escape character is shown when the server/database name has some special characters.
| `Issue #5998 <https://redmine.postgresql.org/issues/5998>`_ - Fixed an issue where schema diff doesn't show the result of compare if source schema has tables with RLS.

View File

@ -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:

View File

@ -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 }};

View File

@ -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 }};

View File

@ -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 }};