Fixed an issue where the user is unable to update column-level privileges from the security tab. Fixes #6117

pull/41/head
Rahul Shirsat 2021-02-10 17:56:26 +05:30 committed by Akshay Joshi
parent 1b850ff616
commit 2036e9d9a8
357 changed files with 4696 additions and 45 deletions

View File

@ -28,6 +28,7 @@ Bug fixes
| `Issue #5871 <https://redmine.postgresql.org/issues/5871>`_ - Ensure that username should be visible in the 'Connect to Server' popup when service and user name both specified.
| `Issue #6045 <https://redmine.postgresql.org/issues/6045>`_ - Fixed autocomplete issue where it is not showing any suggestions if the schema name contains escape characters.
| `Issue #6087 <https://redmine.postgresql.org/issues/6087>`_ - Fixed an issue where the dependencies tab showing multiple owners for the objects having shared dependencies.
| `Issue #6117 <https://redmine.postgresql.org/issues/6117>`_ - Fixed an issue where the user is unable to update column-level privileges from the security tab.
| `Issue #6143 <https://redmine.postgresql.org/issues/6143>`_ - Fixed an issue where shared server entries not getting deleted from SQLite database if the user gets deleted.
| `Issue #6157 <https://redmine.postgresql.org/issues/6157>`_ - Fixed an issue where strike-through is not visible for rows selected for deletion after scrolling.
| `Issue #6163 <https://redmine.postgresql.org/issues/6163>`_ - Fixed an issue where Zoom to fit button only works if the diagram is larger than the canvas.

View File

@ -58,10 +58,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -60,10 +60,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -59,7 +59,11 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{ o_data.proargtyp
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -56,10 +56,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -58,10 +58,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -55,10 +55,12 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{ o_data.proargtyp
{% endfor %}{% endif %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}{% endif %}
{% if 'added' in data.acl %}
{% for priv in data.acl.added %}

View File

@ -60,10 +60,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -59,7 +59,11 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{ o_data.proargtyp
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -56,10 +56,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -58,10 +58,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -47,10 +47,14 @@ ALTER PROCEDURE {{ conn|qtIdent(o_data.pronamespace, name) }}{% if o_data.proarg
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'PROCEDURE', priv.grantee, name, priv.without_grant,
priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}

View File

@ -57,10 +57,14 @@ ALTER PROCEDURE {{ conn|qtIdent(o_data.pronamespace, name) }}{% if o_data.proarg
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'PROCEDURE', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -45,7 +45,11 @@ ALTER PROCEDURE {{ conn|qtIdent(o_data.pronamespace, name) }}{% if o_data.proarg
{% if 'changed' in data.datacl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'PROCEDURE', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -48,7 +48,11 @@ ALTER PROCEDURE {{ conn|qtIdent(o_data.pronamespace, name) }}{% if o_data.proarg
{% if 'changed' in data.datacl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'PROCEDURE', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'PROCEDURE', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -50,10 +50,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -53,7 +53,11 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{ o_data.proargtyp
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -50,10 +50,14 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{o_data.proargtype
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}
{% endif -%}
{% if 'changed' in data.datacl %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}
{% endfor %}

View File

@ -49,7 +49,12 @@ ALTER FUNCTION {{ conn|qtIdent(o_data.pronamespace, name) }}({{ o_data.proargtyp
{% endfor %}{% endif %}
{% if 'changed' in data.acl %}
{% for priv in data.acl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.old_grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'FUNCTION', priv.grantee, name, o_data.pronamespace, o_data.proargtypenames) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'FUNCTION', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.pronamespace, o_data.proargtypenames) }}

View File

@ -0,0 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,21 @@
-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
)
RETURNS character varying
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
SET enable_sort='true'
AS $BODY$
begin
select '1';
end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,13 @@
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(IN i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM postgres;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;

View File

@ -0,0 +1,18 @@
-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';

View File

@ -214,7 +214,58 @@
},
{
"type": "alter",
"name": "Alter function add acl.",
"name": "Alter function remove partial privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter function change grantee in privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_function_change_grantee_acl.sql",
"expected_msql_file": "alter_function_change_grantee_acl.msql"
},
{
"type": "alter",
"name": "Alter function delete acl.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",

View File

@ -47,7 +47,91 @@
},
"expected_sql_file": "alter_proc_param.sql",
"expected_msql_file": "alter_proc_param_msql.sql"
}, {
},
{
"type": "alter",
"name": "Alter procedure add privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
},
{
"grantee": "postgres",
"grantor": "postgres",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter procedure delete privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter procedure change privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_proc_change_grantee_priv.sql",
"expected_msql_file": "alter_proc_change_grantee_priv.msql"
},
{
"type": "delete",
"name": "Drop procedure",
"endpoint": "NODE-procedure.delete_id",

View File

@ -0,0 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,21 @@
-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
)
RETURNS character varying
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
SET enable_sort='true'
AS $BODY$
begin
select '1';
end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,13 @@
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(IN i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM postgres;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;

View File

@ -0,0 +1,18 @@
-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';

View File

@ -214,7 +214,58 @@
},
{
"type": "alter",
"name": "Alter function add acl.",
"name": "Alter function remove partial privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter function change grantee in privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_function_change_grantee_acl.sql",
"expected_msql_file": "alter_function_change_grantee_acl.msql"
},
{
"type": "alter",
"name": "Alter function delete acl.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",

View File

@ -47,7 +47,91 @@
},
"expected_sql_file": "alter_proc_param.sql",
"expected_msql_file": "alter_proc_param_msql.sql"
}, {
},
{
"type": "alter",
"name": "Alter procedure add privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
},
{
"grantee": "postgres",
"grantor": "postgres",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter procedure delete privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter procedure change privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_proc_change_grantee_priv.sql",
"expected_msql_file": "alter_proc_change_grantee_priv.msql"
},
{
"type": "delete",
"name": "Drop procedure",
"endpoint": "NODE-procedure.delete_id",

View File

@ -0,0 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,21 @@
-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
)
RETURNS character varying
LANGUAGE 'plpgsql'
COST 100
VOLATILE WINDOW
SET enable_sort='true'
AS $BODY$
begin
select '1';
end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -213,7 +213,58 @@
},
{
"type": "alter",
"name": "Alter function add acl.",
"name": "Alter function remove partial privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter function change grantee in privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_function_change_grantee_acl.sql",
"expected_msql_file": "alter_function_change_grantee_acl.msql"
},
{
"type": "alter",
"name": "Alter function delete acl.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",

View File

@ -0,0 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,21 @@
-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
)
RETURNS character varying
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
SET enable_sort='true'
AS $BODY$
begin
select '1';
end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -214,7 +214,58 @@
},
{
"type": "alter",
"name": "Alter function add acl.",
"name": "Alter function remove partial privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter function change grantee in privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_function_change_grantee_acl.sql",
"expected_msql_file": "alter_function_change_grantee_acl.msql"
},
{
"type": "alter",
"name": "Alter function delete acl.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",

View File

@ -0,0 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM enterprisedb;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,21 @@
-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
)
RETURNS character varying
LANGUAGE 'plpgsql'
COST 100
VOLATILE SECURITY DEFINER PARALLEL UNSAFE
SET enable_sort='true'
AS $BODY$
begin
select '1';
end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO enterprisedb;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,13 @@
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(IN i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM enterprisedb;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;

View File

@ -0,0 +1,18 @@
-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';

View File

@ -224,6 +224,57 @@
"expected_sql_file": "alter_function_add_acl.sql",
"expected_msql_file": "alter_function_add_acl.msql"
},
{
"type": "alter",
"name": "Alter function remove partial privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter function change grantee in privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"old_grantee": "enterprisedb",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_function_change_grantee_acl.sql",
"expected_msql_file": "alter_function_change_grantee_acl.msql"
},
{
"type": "alter",
"name": "Alter function add acl.",

View File

@ -47,7 +47,91 @@
},
"expected_sql_file": "alter_proc_param.sql",
"expected_msql_file": "alter_proc_param_msql.sql"
}, {
},
{
"type": "alter",
"name": "Alter procedure add privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
},
{
"grantee": "enterprisedb",
"grantor": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter procedure delete privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter procedure change privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"old_grantee": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_proc_change_grantee_priv.sql",
"expected_msql_file": "alter_proc_change_grantee_priv.msql"
},
{
"type": "delete",
"name": "Drop procedure",
"endpoint": "NODE-procedure.delete_id",

View File

@ -0,0 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM enterprisedb;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,21 @@
-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
)
RETURNS character varying
LANGUAGE 'plpgsql'
COST 100
VOLATILE SECURITY DEFINER PARALLEL UNSAFE
SET enable_sort='true'
AS $BODY$
begin
select '1';
end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO enterprisedb;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,13 @@
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(IN i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM enterprisedb;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;

View File

@ -0,0 +1,18 @@
-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';

View File

@ -226,7 +226,58 @@
},
{
"type": "alter",
"name": "Alter function add acl.",
"name": "Alter function remove partial privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter function change grantee in privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"old_grantee": "enterprisedb",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_function_change_grantee_acl.sql",
"expected_msql_file": "alter_function_change_grantee_acl.msql"
},
{
"type": "alter",
"name": "Alter function delete acl.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",

View File

@ -47,7 +47,91 @@
},
"expected_sql_file": "alter_proc_param.sql",
"expected_msql_file": "alter_proc_param_msql.sql"
}, {
},
{
"type": "alter",
"name": "Alter procedure add privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
},
{
"grantee": "enterprisedb",
"grantor": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter procedure delete privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter procedure change privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"old_grantee": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_proc_change_grantee_priv.sql",
"expected_msql_file": "alter_proc_change_grantee_priv.msql"
},
{
"type": "delete",
"name": "Drop procedure",
"endpoint": "NODE-procedure.delete_id",

View File

@ -0,0 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM enterprisedb;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,21 @@
-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
)
RETURNS character varying
LANGUAGE 'plpgsql'
VOLATILE SECURITY DEFINER WINDOW
COST 100
SET enable_sort='true'
AS $BODY$
begin
select '1';
end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO enterprisedb;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -225,7 +225,58 @@
},
{
"type": "alter",
"name": "Alter function add acl.",
"name": "Alter function remove partial privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter function change grantee in privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"old_grantee": "enterprisedb",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_function_change_grantee_acl.sql",
"expected_msql_file": "alter_function_change_grantee_acl.msql"
},
{
"type": "alter",
"name": "Alter function delete acl.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",

View File

@ -0,0 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM enterprisedb;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,21 @@
-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
)
RETURNS character varying
LANGUAGE 'plpgsql'
COST 100
VOLATILE SECURITY DEFINER PARALLEL UNSAFE
SET enable_sort='true'
AS $BODY$
begin
select '1';
end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO enterprisedb;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;

View File

@ -0,0 +1,13 @@
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(IN i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM enterprisedb;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;

View File

@ -0,0 +1,18 @@
-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
i1 integer)
LANGUAGE 'plpgsql'
SET application_name='pgadmin'
AS $BODY$
begin
select 1;
end;
$BODY$;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';

View File

@ -226,7 +226,58 @@
},
{
"type": "alter",
"name": "Alter function add acl.",
"name": "Alter function remove partial privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
}
},
{
"type": "alter",
"name": "Alter function change grantee in privileges.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",
"data": {
"acl": {
"changed": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"old_grantee": "enterprisedb",
"privileges": [
{
"privilege_type": "X",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_function_change_grantee_acl.sql",
"expected_msql_file": "alter_function_change_grantee_acl.msql"
},
{
"type": "alter",
"name": "Alter function delete acl.",
"endpoint": "NODE-function.obj_id",
"msql_endpoint": "NODE-function.msql_id",
"sql_endpoint": "NODE-function.sql_id",

View File

@ -77,6 +77,40 @@
"expected_sql_file": "alter_proc_opt.sql",
"expected_msql_file": "alter_proc_opt_msql.sql"
},
{
"type": "alter",
"name": "Alter procedure add privileges",
"endpoint": "NODE-procedure.obj_id",
"sql_endpoint": "NODE-procedure.sql_id",
"data": {
"acl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
},
{
"grantee": "enterprisedb",
"grantor": "enterprisedb",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": false
}
]
}
]
}
}
},
{
"type": "delete",
"name": "Drop procedure",

View File

@ -84,7 +84,11 @@ COMMENT ON SEQUENCE {{ seqname }}
{% endif %}
{% if 'changed' in data.relacl %}
{% for priv in data.relacl.changed %}
{% if priv.grantee != priv.old_grantee %}
{{ PRIVILEGE.UNSETALL(conn, 'SEQUENCE', priv.old_grantee, data.name, schema) }}
{% else %}
{{ PRIVILEGE.UNSETALL(conn, 'SEQUENCE', priv.grantee, data.name, schema) }}
{% endif %}
{{ PRIVILEGE.SET(conn, 'SEQUENCE', priv.grantee, data.name, priv.without_grant, priv.with_grant, schema) }}
{% endfor %}
{% endif %}

View File

@ -0,0 +1,19 @@
-- SEQUENCE: public.Seq1_$%{}[]()&*^!@"'`\/#
-- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
CYCLE
INCREMENT 12
START 5
MINVALUE 2
MAXVALUE 9992
CACHE 2;
ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;
COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
IS 'Some comment';
GRANT SELECT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -0,0 +1,2 @@
REVOKE ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" FROM postgres;
GRANT SELECT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -15,5 +15,3 @@ ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
IS 'Some comment';
GRANT ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO postgres;

View File

@ -93,7 +93,51 @@
},
"expected_sql_file": "alter_seq_privs_update.sql",
"expected_msql_file": "alter_seq_privs_update_msql.sql"
},{
},
{
"type": "alter",
"name": "Alter Sequence remove partial privileges",
"endpoint": "NODE-sequence.obj_id",
"sql_endpoint": "NODE-sequence.sql_id",
"msql_endpoint": "NODE-sequence.msql_id",
"data": {
"relacl": {
"deleted":[{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges":[{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}]
}]
}
}
},
{
"type": "alter",
"name": "Alter Sequence change grantee in privileges",
"endpoint": "NODE-sequence.obj_id",
"sql_endpoint": "NODE-sequence.sql_id",
"msql_endpoint": "NODE-sequence.msql_id",
"data": {
"relacl": {
"changed":[{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"privileges":[{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}]
}]
}
},
"expected_sql_file": "alter_seq_change_grantee_privs.sql",
"expected_msql_file": "alter_seq_change_grantee_privs_msql.sql"
},
{
"type": "alter",
"name": "Alter Sequence remove privileges",
"endpoint": "NODE-sequence.obj_id",

View File

@ -0,0 +1,19 @@
-- SEQUENCE: public.Seq1_$%{}[]()&*^!@"'`\/#
-- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
CYCLE
INCREMENT 12
START 5
MINVALUE 2
MAXVALUE 9992
CACHE 2;
ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
OWNER TO enterprisedb;
COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
IS 'Some comment';
GRANT SELECT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -0,0 +1,2 @@
REVOKE ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" FROM enterprisedb;
GRANT SELECT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -15,5 +15,3 @@ ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
IS 'Some comment';
GRANT ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO enterprisedb;

View File

@ -93,7 +93,51 @@
},
"expected_sql_file": "alter_seq_privs_update.sql",
"expected_msql_file": "alter_seq_privs_update_msql.sql"
},{
},
{
"type": "alter",
"name": "Alter Sequence remove partial privileges",
"endpoint": "NODE-sequence.obj_id",
"sql_endpoint": "NODE-sequence.sql_id",
"msql_endpoint": "NODE-sequence.msql_id",
"data": {
"relacl": {
"deleted":[{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges":[{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}]
}]
}
}
},
{
"type": "alter",
"name": "Alter Sequence change grantee in privileges",
"endpoint": "NODE-sequence.obj_id",
"sql_endpoint": "NODE-sequence.sql_id",
"msql_endpoint": "NODE-sequence.msql_id",
"data": {
"relacl": {
"changed":[{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"old_grantee": "enterprisedb",
"privileges":[{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}]
}]
}
},
"expected_sql_file": "alter_seq_change_grantee_privs.sql",
"expected_msql_file": "alter_seq_change_grantee_privs_msql.sql"
},
{
"type": "alter",
"name": "Alter Sequence remove privileges",
"endpoint": "NODE-sequence.obj_id",

View File

@ -0,0 +1,2 @@
REVOKE ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" FROM postgres;
GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO postgres;

View File

@ -0,0 +1,13 @@
-- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
IS 'Comment for alter';
GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO postgres;

Some files were not shown because too many files have changed in this diff Show More