mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Fixed column "none" does not exist issue, while comparing schema objects. Fixes #7591
2) Fixed an issue where schema diff did not pick up the change in RLS policy. Fixes #7596 3) Ensure that schema diff maintains view ownership when view definitions are modified. Fixes #7611
This commit is contained in:
parent
306b184e11
commit
e455114441
@ -38,5 +38,8 @@ Bug fixes
|
|||||||
| `Issue #7575 <https://redmine.postgresql.org/issues/7575>`_ - Fixed an issue where Alt-Shift-Q didn't work after creating a new query.
|
| `Issue #7575 <https://redmine.postgresql.org/issues/7575>`_ - Fixed an issue where Alt-Shift-Q didn't work after creating a new query.
|
||||||
| `Issue #7586 <https://redmine.postgresql.org/issues/7586>`_ - Fixed an issue with rendering geometry when selecting a complete column.
|
| `Issue #7586 <https://redmine.postgresql.org/issues/7586>`_ - Fixed an issue with rendering geometry when selecting a complete column.
|
||||||
| `Issue #7587 <https://redmine.postgresql.org/issues/7587>`_ - Ensure that the children of information_schema and pg_catalog node should be displayed.
|
| `Issue #7587 <https://redmine.postgresql.org/issues/7587>`_ - Ensure that the children of information_schema and pg_catalog node should be displayed.
|
||||||
|
| `Issue #7591 <https://redmine.postgresql.org/issues/7591>`_ - Fixed column "none" does not exist issue, while comparing schema objects.
|
||||||
|
| `Issue #7596 <https://redmine.postgresql.org/issues/7596>`_ - Fixed an issue where schema diff did not pick up the change in RLS policy.
|
||||||
| `Issue #7608 <https://redmine.postgresql.org/issues/7608>`_ - Fixed an issue where the cloud deployment wizard creates the cluster with the High Availability even if that option is not selected.
|
| `Issue #7608 <https://redmine.postgresql.org/issues/7608>`_ - Fixed an issue where the cloud deployment wizard creates the cluster with the High Availability even if that option is not selected.
|
||||||
|
| `Issue #7611 <https://redmine.postgresql.org/issues/7611>`_ - Ensure that schema diff maintains view ownership when view definitions are modified.
|
||||||
| `Issue #7614 <https://redmine.postgresql.org/issues/7614>`_ - Fixed crypt key is missing issue when logout from the pgAdmin.
|
| `Issue #7614 <https://redmine.postgresql.org/issues/7614>`_ - Fixed crypt key is missing issue when logout from the pgAdmin.
|
||||||
|
@ -616,7 +616,7 @@ class RowSecurityView(PGChildNodeView):
|
|||||||
data['schema'] = self.schema
|
data['schema'] = self.schema
|
||||||
data['table'] = self.table
|
data['table'] = self.table
|
||||||
sql, name = row_security_policies_utils.get_sql(
|
sql, name = row_security_policies_utils.get_sql(
|
||||||
self.conn, data=data, scid=scid, plid=oid,
|
self.conn, data=data, scid=scid, plid=oid, policy_table_id=tid,
|
||||||
schema=self.schema, table=self.table)
|
schema=self.schema, table=self.table)
|
||||||
|
|
||||||
sql = sql.strip('\n').strip(' ')
|
sql = sql.strip('\n').strip(' ')
|
||||||
|
@ -49,6 +49,11 @@ WITH(
|
|||||||
{% elif o_data.with_data is defined %}
|
{% elif o_data.with_data is defined %}
|
||||||
WITH {{ 'DATA' if o_data.with_data else 'NO DATA' }};
|
WITH {{ 'DATA' if o_data.with_data else 'NO DATA' }};
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% if o_data.owner and not data.owner %}
|
||||||
|
ALTER TABLE IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
|
OWNER TO {{ conn|qtIdent(o_data.owner) }};
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if o_data.comment and not data.comment %}
|
{% if o_data.comment and not data.comment %}
|
||||||
COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
|
@ -49,6 +49,11 @@ WITH(
|
|||||||
{% elif o_data.with_data is defined %}
|
{% elif o_data.with_data is defined %}
|
||||||
WITH {{ 'DATA' if o_data.with_data else 'NO DATA' }};
|
WITH {{ 'DATA' if o_data.with_data else 'NO DATA' }};
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% if o_data.owner and not data.owner %}
|
||||||
|
ALTER TABLE IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
|
OWNER TO {{ conn|qtIdent(o_data.owner) }};
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if o_data.comment and not data.comment %}
|
{% if o_data.comment and not data.comment %}
|
||||||
COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
|
@ -6,16 +6,17 @@
|
|||||||
{% set view_schema = data.schema if data.schema else o_data.schema %}
|
{% set view_schema = data.schema if data.schema else o_data.schema %}
|
||||||
{% set def = data.definition.rstrip(';') if data.definition %}
|
{% set def = data.definition.rstrip(';') if data.definition %}
|
||||||
{% if data.name and data.name != o_data.name %}
|
{% if data.name and data.name != o_data.name %}
|
||||||
ALTER VIEW {{ conn|qtIdent(o_data.schema, o_data.name) }}
|
ALTER VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, o_data.name) }}
|
||||||
RENAME TO {{ conn|qtIdent(data.name) }};
|
RENAME TO {{ conn|qtIdent(data.name) }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if data.schema and data.schema != o_data.schema %}
|
{% if data.schema and data.schema != o_data.schema %}
|
||||||
ALTER VIEW {{ conn|qtIdent(o_data.schema, view_name ) }}
|
ALTER VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, view_name ) }}
|
||||||
SET SCHEMA {{ conn|qtIdent(data.schema) }};
|
SET SCHEMA {{ conn|qtIdent(data.schema) }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if def and def != o_data.definition.rstrip(';') %}
|
{% if def and def != o_data.definition.rstrip(';') %}
|
||||||
{% if data.del_sql %}
|
{% if data.del_sql %}
|
||||||
DROP VIEW {{ conn|qtIdent(view_schema, view_name) }};
|
DROP VIEW {{ conn|qtIdent(view_schema, view_name) }};
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
CREATE OR REPLACE VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
CREATE OR REPLACE VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
{% if ((data.check_option and data.check_option.lower() != 'no') or data.security_barrier) %}
|
{% if ((data.check_option and data.check_option.lower() != 'no') or data.security_barrier) %}
|
||||||
@ -23,20 +24,25 @@ CREATE OR REPLACE VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
AS
|
AS
|
||||||
{{ def }};
|
{{ def }};
|
||||||
|
{% if data.del_sql and data.owner is not defined %}
|
||||||
|
|
||||||
|
ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
|
OWNER TO {{ conn|qtIdent(o_data.owner) }};
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if (data.security_barrier is defined and data.security_barrier|lower != o_data.security_barrier|lower) %}
|
{% if (data.security_barrier is defined and data.security_barrier|lower != o_data.security_barrier|lower) %}
|
||||||
ALTER VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
SET (security_barrier={{ data.security_barrier|lower }});
|
SET (security_barrier={{ data.security_barrier|lower }});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (data.check_option and data.check_option != o_data.check_option and data.check_option != 'no') %}
|
{% if (data.check_option and data.check_option != o_data.check_option and data.check_option != 'no') %}
|
||||||
ALTER VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
SET (check_option={{ data.check_option }});
|
SET (check_option={{ data.check_option }});
|
||||||
{% elif (data.check_option and data.check_option != o_data.check_option and data.check_option == 'no') %}
|
{% elif (data.check_option and data.check_option != o_data.check_option and data.check_option == 'no') %}
|
||||||
ALTER VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET (check_option);
|
ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET (check_option);
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if data.owner and data.owner != o_data.owner %}
|
{% if data.owner and data.owner != o_data.owner %}
|
||||||
ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
|
ALTER TABLE IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
OWNER TO {{ conn|qtIdent(data.owner) }};
|
OWNER TO {{ conn|qtIdent(data.owner) }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set old_comment = o_data.comment|default('', true) %}
|
{% set old_comment = o_data.comment|default('', true) %}
|
||||||
|
@ -16,6 +16,7 @@ ALTER VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, view_name ) }}
|
|||||||
{% if def and def != o_data.definition.rstrip(';') %}
|
{% if def and def != o_data.definition.rstrip(';') %}
|
||||||
{% if data.del_sql %}
|
{% if data.del_sql %}
|
||||||
DROP VIEW {{ conn|qtIdent(view_schema, view_name) }};
|
DROP VIEW {{ conn|qtIdent(view_schema, view_name) }};
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
CREATE OR REPLACE VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
CREATE OR REPLACE VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
{% if ((data.check_option and data.check_option.lower() != 'no') or data.security_barrier) %}
|
{% if ((data.check_option and data.check_option.lower() != 'no') or data.security_barrier) %}
|
||||||
@ -23,6 +24,11 @@ CREATE OR REPLACE VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
AS
|
AS
|
||||||
{{ def }};
|
{{ def }};
|
||||||
|
{% if data.del_sql and data.owner is not defined %}
|
||||||
|
|
||||||
|
ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
|
OWNER TO {{ conn|qtIdent(o_data.owner) }};
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if (data.security_barrier is defined and data.security_barrier|lower != o_data.security_barrier|lower) %}
|
{% if (data.security_barrier is defined and data.security_barrier|lower != o_data.security_barrier|lower) %}
|
||||||
ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
|
ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
|
||||||
|
@ -4,5 +4,8 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
|
|||||||
SELECT 12 AS col1
|
SELECT 12 AS col1
|
||||||
WITH NO DATA;
|
WITH NO DATA;
|
||||||
|
|
||||||
|
ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
|
||||||
|
OWNER TO postgres;
|
||||||
|
|
||||||
COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
|
COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
|
||||||
IS 'comment1';
|
IS 'comment1';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
ALTER VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
ALTER VIEW IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||||
SET (security_barrier=true);
|
SET (security_barrier=true);
|
||||||
ALTER VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
ALTER VIEW IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||||
SET (check_option=cascaded);
|
SET (check_option=cascaded);
|
||||||
GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||||
|
|
||||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||||
AS
|
AS
|
||||||
SELECT * FROM test_view_table;
|
SELECT * FROM test_view_table;
|
||||||
|
|
||||||
|
ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
|
||||||
|
OWNER TO postgres;
|
||||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||||
IS 'Testcomment-updated';
|
IS 'Testcomment-updated';
|
||||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres;
|
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
ALTER VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
ALTER VIEW IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||||
SET (security_barrier=true);
|
SET (security_barrier=true);
|
||||||
ALTER VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
ALTER VIEW IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||||
SET (check_option=cascaded);
|
SET (check_option=cascaded);
|
||||||
|
|
||||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||||
|
@ -4,5 +4,8 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
|
|||||||
SELECT 12 AS col1
|
SELECT 12 AS col1
|
||||||
WITH NO DATA;
|
WITH NO DATA;
|
||||||
|
|
||||||
|
ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
|
||||||
|
OWNER TO enterprisedb;
|
||||||
|
|
||||||
COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
|
COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
|
||||||
IS 'comment1';
|
IS 'comment1';
|
||||||
|
Loading…
Reference in New Issue
Block a user