mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where the semicolon is misplaced in RLS Policy SQL.
Fixed one regression issue introduced by renaming the method 'gc' to 'gc_timeout'.
This commit is contained in:
parent
115657a465
commit
b91f6f0f5c
@ -5,6 +5,5 @@
|
||||
CREATE POLICY policy_1
|
||||
ON public.test_rls_policy
|
||||
FOR ALL
|
||||
TO public
|
||||
;
|
||||
TO public;
|
||||
|
||||
|
@ -5,6 +5,5 @@
|
||||
CREATE POLICY insert_policy
|
||||
ON public.test_rls_policy
|
||||
FOR INSERT
|
||||
TO public
|
||||
;
|
||||
TO public;
|
||||
|
||||
|
@ -5,6 +5,5 @@
|
||||
CREATE POLICY test
|
||||
ON public.test_rls_policy
|
||||
FOR ALL
|
||||
TO public
|
||||
;
|
||||
TO public;
|
||||
|
||||
|
@ -5,6 +5,5 @@
|
||||
CREATE POLICY select_policy
|
||||
ON public.test_rls_policy
|
||||
FOR SELECT
|
||||
TO public
|
||||
;
|
||||
TO public;
|
||||
|
||||
|
@ -2,6 +2,12 @@
|
||||
-- POLICY: {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }}
|
||||
|
||||
-- DROP POLICY {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }};
|
||||
{% set add_semicolon_after = 'to' %}
|
||||
{% if data.withcheck is defined and data.withcheck != None and data.withcheck != '' %}
|
||||
{% set add_semicolon_after = 'with_check' %}
|
||||
{% elif data.using is defined and data.using != None and data.using != '' %}
|
||||
{% set add_semicolon_after = 'using' %}
|
||||
{% endif %}
|
||||
|
||||
CREATE POLICY {{ conn|qtIdent(data.name) }}
|
||||
ON {{conn|qtIdent(data.schema, data.table)}}
|
||||
@ -9,13 +15,15 @@ CREATE POLICY {{ conn|qtIdent(data.name) }}
|
||||
FOR {{ data.event|upper }}
|
||||
{% endif %}
|
||||
{% if data.policyowner %}
|
||||
TO {{ conn|qtTypeIdent(data.policyowner) }}
|
||||
TO {{ conn|qtTypeIdent(data.policyowner) }}{% if add_semicolon_after == 'to' %};{% endif %}
|
||||
{% else %}
|
||||
TO public
|
||||
TO public{% if add_semicolon_after == 'to' %};{% endif %}
|
||||
{% endif %}
|
||||
{% if data.using %}
|
||||
USING ({{ data.using }})
|
||||
|
||||
USING ({{ data.using }}){% if add_semicolon_after == 'using' %};{% endif %}
|
||||
{% endif %}
|
||||
{% if data.withcheck %}
|
||||
WITH CHECK ({{ data.withcheck }})
|
||||
{% endif %};
|
||||
|
||||
WITH CHECK ({{ data.withcheck }});
|
||||
{% endif %}
|
||||
|
@ -46,4 +46,4 @@ def ping():
|
||||
drivers = getattr(current_app, '_pgadmin_server_drivers', None)
|
||||
|
||||
for type in drivers:
|
||||
drivers[type].gc()
|
||||
drivers[type].gc_timeout()
|
||||
|
Loading…
Reference in New Issue
Block a user