diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/12_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/12_plus/create.sql
index 565b86f..ae886d4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/12_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/12_plus/create.sql
@@ -32,8 +32,7 @@ CREATE{% if query_type is defined %}{{' OR REPLACE'}}{% endif %} FUNCTION {{ con
     ROWS {{data.prorows}}{% endif %}
 
     {% if data.prosupportfunc %}SUPPORT {{ data.prosupportfunc }}{% endif -%}{% if data.variables %}{% for v in data.variables %}
-
-    SET {{ conn|qtIdent(v.name) }}={% if v.name in exclude_quoting %}{{ v.value }}{% else %}{{ v.value|qtLiteral }}{% endif %}{% endfor %}
+SET {{ conn|qtIdent(v.name) }}={% if v.name in exclude_quoting %}{{ v.value }}{% else %}{{ v.value|qtLiteral }}{% endif %}{% endfor %}
 {% endif %}
 
 AS {% if data.lanname == 'c' %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/12_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/12_plus/create.sql
index 99b64e3..605fdf0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/12_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/12_plus/create.sql
@@ -19,17 +19,16 @@ CREATE{% if query_type is defined %}{{' OR REPLACE'}}{% endif %} FUNCTION {{ con
     LANGUAGE {{ data.lanname|qtLiteral }}
     {% if data.provolatile %}{% if data.provolatile == 'i' %}IMMUTABLE{% elif data.provolatile == 's' %}STABLE{% else %}VOLATILE{% endif %} {% endif %}{% if data.proleakproof %}LEAKPROOF {% endif %}
 {% if data.proisstrict %}STRICT {% endif %}
-{% if data.prosecdef %}SECURITY DEFINER {% endif %}
-{% if data.proiswindow %}WINDOW {% endif %}
+{% if data.prosecdef %}SECURITY DEFINER{% endif %}
+{% if data.proiswindow %} WINDOW{% endif %}
 {% if data.proparallel and (data.proparallel == 'r' or data.proparallel == 's' or data.proparallel == 'u') %}
-{% if data.proparallel == 'r' %} PARALLEL RESTRICTED{% elif data.proparallel == 's' %} PARALLEL SAFE {% elif data.proparallel == 'u' %} PARALLEL UNSAFE{% endif %}{% endif %}
+{% if data.proparallel == 'r' %} PARALLEL RESTRICTED{% elif data.proparallel == 's' %} PARALLEL SAFE{% elif data.proparallel == 'u' %} PARALLEL UNSAFE{% endif %}{% endif %}
 {% if data.procost %}
 
     COST {{data.procost}}{% endif %}{% if data.prorows and (data.prorows | int) > 0 %}
 
     ROWS {{data.prorows}}{% endif %}
-
-    {% if data.prosupportfunc %}SUPPORT {{ data.prosupportfunc }}{% endif -%}{% if data.variables %}{% for v in data.variables %}
+{% if data.prosupportfunc %}SUPPORT {{ data.prosupportfunc }}{% endif -%}{% if data.variables %}{% for v in data.variables %}
 
     SET {{ conn|qtIdent(v.name) }}={% if v.name in exclude_quoting %}{{ v.value }}{% else %}{{ v.value|qtLiteral }}{% endif %}{% endfor %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.6_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.6_plus/create.sql
index fd2383b..f59520e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.6_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.6_plus/create.sql
@@ -19,10 +19,10 @@ CREATE{% if query_type is defined %}{{' OR REPLACE'}}{% endif %} FUNCTION {{ con
     LANGUAGE {{ data.lanname|qtLiteral }}
     {% if data.provolatile %}{% if data.provolatile == 'i' %}IMMUTABLE{% elif data.provolatile == 's' %}STABLE{% else %}VOLATILE{% endif %} {% endif %}{% if data.proleakproof %}LEAKPROOF {% endif %}
 {% if data.proisstrict %}STRICT {% endif %}
-{% if data.prosecdef %}SECURITY DEFINER {% endif %}
-{% if data.proiswindow %}WINDOW {% endif %}
+{% if data.prosecdef %}SECURITY DEFINER{% endif %}
+{% if data.proiswindow %} WINDOW{% endif %}
 {% if data.proparallel and (data.proparallel == 'r' or data.proparallel == 's' or data.proparallel == 'u') %}
-{% if data.proparallel == 'r' %} PARALLEL RESTRICTED{% elif data.proparallel == 's' %} PARALLEL SAFE {% elif data.proparallel == 'u' %} PARALLEL UNSAFE{% endif %}{% endif %}
+{% if data.proparallel == 'r' %} PARALLEL RESTRICTED{% elif data.proparallel == 's' %} PARALLEL SAFE{% elif data.proparallel == 'u' %} PARALLEL UNSAFE{% endif %}{% endif %}
 {% if data.procost %}
 
     COST {{data.procost}}{% endif %}{% if data.prorows and (data.prorows | int) > 0 %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/default/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/default/acl.sql
index ebbbe7d..822e53b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/default/acl.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/default/acl.sql
@@ -32,4 +32,5 @@ FROM
     ) d
     LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
     LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
-GROUP BY g.rolname, gt.rolname;
+GROUP BY g.rolname, gt.rolname
+ORDER BY grantee
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.msql
new file mode 100644
index 0000000..82ce0c5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.msql
@@ -0,0 +1 @@
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.sql
new file mode 100644
index 0000000..100b8f0
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.sql
@@ -0,0 +1,25 @@
+-- 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 postgres;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.msql
new file mode 100644
index 0000000..ae35deb
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.msql
@@ -0,0 +1,13 @@
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE
+    PARALLEL UNSAFE
+    COST 100
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.sql
new file mode 100644
index 0000000..a34ddda
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.sql
@@ -0,0 +1,21 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.msql
new file mode 100644
index 0000000..12b3a14
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.msql
@@ -0,0 +1,2 @@
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.sql
new file mode 100644
index 0000000..f87e09b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.sql
@@ -0,0 +1,23 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.msql
new file mode 100644
index 0000000..1393bd7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.msql
@@ -0,0 +1,3 @@
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.sql
new file mode 100644
index 0000000..b189ba6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.sql
@@ -0,0 +1,20 @@
+-- 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.msql
new file mode 100644
index 0000000..f215838
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RESET application_name;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.sql
new file mode 100644
index 0000000..cd8074e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.msql
new file mode 100644
index 0000000..8ddfca7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    RENAME TO "Function3_$%{}[]()&*^!@""'`\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.sql
new file mode 100644
index 0000000..a5c051d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.msql
new file mode 100644
index 0000000..8492738
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.msql
@@ -0,0 +1,15 @@
+CREATE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(IN param character varying DEFAULT '1')
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.sql
new file mode 100644
index 0000000..e05adf5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.sql
@@ -0,0 +1,21 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.msql
new file mode 100644
index 0000000..bfb27b3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.msql
@@ -0,0 +1,15 @@
+CREATE 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.sql
new file mode 100644
index 0000000..b189ba6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.sql
@@ -0,0 +1,20 @@
+-- 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_function.json
new file mode 100644
index 0000000..43c034d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_function.json
@@ -0,0 +1,260 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create function with all options.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function1_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proretset": false,
+        "proisstrict": true,
+        "prosecdef": true,
+        "proiswindow": true,
+        "proparallel": "u",
+        "procost": "100",
+        "prorows": "0",
+        "proleakproof": true,
+        "arguments": [
+          {
+            "argtype": "character varying",
+            "argmode": "IN",
+            "argname": "param",
+            "argdefval": "'1'"
+          }
+        ],
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function.sql",
+      "expected_msql_file": "create_function.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function comment",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "description": "Some comment"
+      },
+      "expected_sql_file": "alter_function_comment.sql",
+      "expected_msql_file": "alter_function_comment.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for alter.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function rename.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name":"Function3_$%{}[]()&*^!@\"'`\\/#"
+      },
+      "expected_sql_file": "alter_function_rename.sql",
+      "expected_msql_file": "alter_function_rename.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function code and add parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "prosrc": "begin\nselect '2';\nend\n",
+        "variables": {
+          "added": [
+            {
+              "name": "application_name",
+              "value": "appname"
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_parameter.sql",
+      "expected_msql_file": "alter_function_add_parameter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function delete parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "variables": {
+          "deleted": [
+            {
+              "name": "application_name",
+              "value": true
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_parameter.sql",
+      "expected_msql_file": "alter_function_delete_parameter.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for acl.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "acl": {
+          "added": [
+            {
+              "grantee": "postgres",
+              "grantor": "postgres",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_acl.sql",
+      "expected_msql_file": "alter_function_add_acl.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "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
+                }
+              ]
+            },
+            {
+              "grantee": "postgres",
+              "grantor": "postgres",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_acl.sql",
+      "expected_msql_file": "alter_function_delete_acl.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.msql
new file mode 100644
index 0000000..82ce0c5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.msql
@@ -0,0 +1 @@
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.sql
new file mode 100644
index 0000000..100b8f0
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.sql
@@ -0,0 +1,25 @@
+-- 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 postgres;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.msql
new file mode 100644
index 0000000..2102c33
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.msql
@@ -0,0 +1,14 @@
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE
+    PARALLEL UNSAFE
+    COST 100
+    
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.sql
new file mode 100644
index 0000000..a66d0c7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET application_name='appname'SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.msql
new file mode 100644
index 0000000..12b3a14
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.msql
@@ -0,0 +1,2 @@
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.sql
new file mode 100644
index 0000000..f87e09b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.sql
@@ -0,0 +1,23 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.msql
new file mode 100644
index 0000000..1393bd7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.msql
@@ -0,0 +1,3 @@
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.sql
new file mode 100644
index 0000000..b189ba6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.sql
@@ -0,0 +1,20 @@
+-- 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.msql
new file mode 100644
index 0000000..f215838
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RESET application_name;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.sql
new file mode 100644
index 0000000..cd8074e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.msql
new file mode 100644
index 0000000..8ddfca7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    RENAME TO "Function3_$%{}[]()&*^!@""'`\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.sql
new file mode 100644
index 0000000..a5c051d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment.sql
new file mode 100644
index 0000000..86eae9a
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment.sql
@@ -0,0 +1,15 @@
+-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
+
+-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
+
+CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
+	i1 integer)
+LANGUAGE 'plpgsql'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment_msql.sql
new file mode 100644
index 0000000..d48fca1
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment_msql.sql
@@ -0,0 +1,2 @@
+COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param.sql
new file mode 100644
index 0000000..4a8b0b1
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param.sql
@@ -0,0 +1,16 @@
+-- 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$;
+
+COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param_msql.sql
new file mode 100644
index 0000000..52c0f9c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param_msql.sql
@@ -0,0 +1,2 @@
+ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
+    SET application_name=pgadmin;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_comment.sql
new file mode 100644
index 0000000..5f2e770
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_comment.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    VOLATILE NOT LEAKPROOF
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_1.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_1.sql
new file mode 100644
index 0000000..bf48852
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_1.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    STABLE LEAKPROOF STRICT SECURITY DEFINER
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_2.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_2.sql
new file mode 100644
index 0000000..c14baa2
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_2.sql
@@ -0,0 +1,22 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 123
+    IMMUTABLE LEAKPROOF STRICT SECURITY DEFINER
+    SET application_name='appname'
+    SET search_path=public, pg_temp
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_3.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_3.sql
new file mode 100644
index 0000000..7caebc3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_3.sql
@@ -0,0 +1,23 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 123
+    IMMUTABLE LEAKPROOF STRICT SECURITY DEFINER
+    SET application_name='appname2'
+    SET search_path=public, pg_catalog
+    SET array_nulls='true'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_event_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_event_trigger_full.sql
new file mode 100644
index 0000000..1bdbb6e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_event_trigger_full.sql
@@ -0,0 +1,26 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS SETOF event_trigger
+    LANGUAGE 'plpgsql'
+    COST 1234
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW
+    ROWS 4321
+    SET application_name='appname'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION;
+
+REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.msql
new file mode 100644
index 0000000..8492738
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.msql
@@ -0,0 +1,15 @@
+CREATE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(IN param character varying DEFAULT '1')
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.sql
new file mode 100644
index 0000000..e05adf5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.sql
@@ -0,0 +1,21 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.msql
new file mode 100644
index 0000000..bfb27b3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.msql
@@ -0,0 +1,15 @@
+CREATE 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.sql
new file mode 100644
index 0000000..b189ba6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.sql
@@ -0,0 +1,20 @@
+-- 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger.sql
new file mode 100644
index 0000000..191e59c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger.sql
@@ -0,0 +1,17 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    VOLATILE NOT LEAKPROOF
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger_full.sql
new file mode 100644
index 0000000..3a51119
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger_full.sql
@@ -0,0 +1,27 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS SETOF trigger
+    LANGUAGE 'plpgsql'
+    COST 1234
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW
+    ROWS 4321
+    SET application_name='appname'
+    SET search_path=public, pg_temp
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION;
+
+REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.sql
new file mode 100644
index 0000000..c6b6482
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.sql
@@ -0,0 +1,12 @@
+-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
+
+-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
+
+CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
+	i1 integer)
+LANGUAGE 'plpgsql'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_function.json
new file mode 100644
index 0000000..43c034d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_function.json
@@ -0,0 +1,260 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create function with all options.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function1_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proretset": false,
+        "proisstrict": true,
+        "prosecdef": true,
+        "proiswindow": true,
+        "proparallel": "u",
+        "procost": "100",
+        "prorows": "0",
+        "proleakproof": true,
+        "arguments": [
+          {
+            "argtype": "character varying",
+            "argmode": "IN",
+            "argname": "param",
+            "argdefval": "'1'"
+          }
+        ],
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function.sql",
+      "expected_msql_file": "create_function.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function comment",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "description": "Some comment"
+      },
+      "expected_sql_file": "alter_function_comment.sql",
+      "expected_msql_file": "alter_function_comment.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for alter.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function rename.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name":"Function3_$%{}[]()&*^!@\"'`\\/#"
+      },
+      "expected_sql_file": "alter_function_rename.sql",
+      "expected_msql_file": "alter_function_rename.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function code and add parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "prosrc": "begin\nselect '2';\nend\n",
+        "variables": {
+          "added": [
+            {
+              "name": "application_name",
+              "value": "appname"
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_parameter.sql",
+      "expected_msql_file": "alter_function_add_parameter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function delete parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "variables": {
+          "deleted": [
+            {
+              "name": "application_name",
+              "value": true
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_parameter.sql",
+      "expected_msql_file": "alter_function_delete_parameter.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for acl.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "acl": {
+          "added": [
+            {
+              "grantee": "postgres",
+              "grantor": "postgres",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_acl.sql",
+      "expected_msql_file": "alter_function_add_acl.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "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
+                }
+              ]
+            },
+            {
+              "grantee": "postgres",
+              "grantor": "postgres",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_acl.sql",
+      "expected_msql_file": "alter_function_delete_acl.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_procedures.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_procedures.json
new file mode 100644
index 0000000..dc9a445
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_procedures.json
@@ -0,0 +1,58 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create procedure",
+      "endpoint": "NODE-procedure.obj",
+      "sql_endpoint": "NODE-procedure.sql_id",
+      "data": {
+        "name": "Proc1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [],
+        "arguments": [{"argtype": "integer", "argmode": "IN", "argname": "i1", "argdefval": ""}],
+        "funcowner": "postgres",
+        "lanname": "plpgsql",
+        "options": [],
+        "pronamespace": 2200,
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [],
+        "schema": "public",
+        "provolatile": null,
+        "proisstrict": false,
+        "proparallel": null,
+        "procost": null,
+        "proleakproof": false,
+        "probin": "$libdir/"
+      },
+      "expected_sql_file": "create_procedure.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter procedure comment",
+      "endpoint": "NODE-procedure.obj_id",
+      "sql_endpoint": "NODE-procedure.sql_id",
+      "data": {
+        "description": "some comment"
+      },
+      "expected_sql_file": "alter_proc_comment.sql",
+      "expected_msql_file": "alter_proc_comment_msql.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter procedure param",
+      "endpoint": "NODE-procedure.obj_id",
+      "sql_endpoint": "NODE-procedure.sql_id",
+      "data": {
+        "variables": {
+          "added": [{"name": "application_name", "value": "pgadmin"}]
+        }
+      },
+      "expected_sql_file": "alter_proc_param.sql",
+      "expected_msql_file": "alter_proc_param_msql.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop procedure",
+      "endpoint": "NODE-procedure.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_trigger_functions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_trigger_functions.json
new file mode 100644
index 0000000..a2e9fc7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_trigger_functions.json
@@ -0,0 +1,191 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [],
+        "args": [],
+        "funcowner": "postgres",
+        "lanname": "plpgsql",
+        "options": [],
+        "pronamespace": 2200,
+        "prorettypename": "trigger",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_plain_trigger.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function comment",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "description": "some comment"
+      },
+      "expected_sql_file": "alter_ptrig_comment.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 1 - Strict, Leakproof, Security of definer, Volatility",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "proisstrict": true,
+        "proleakproof": true,
+        "prosecdef": true,
+        "provolatile": "s"
+      },
+      "expected_sql_file": "alter_ptrig_set_1.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 2 - Cost, Volatility, Add Param",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "procost": "123",
+        "provolatile": "i",
+        "variables": {
+          "added": [{
+            "name": "application_name",
+            "value": "appname"
+          },{
+            "name": "search_path",
+            "value": "public, pg_temp"
+          }]
+        }
+      },
+      "expected_sql_file": "alter_ptrig_set_2.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 3 - Add Param, Change Param",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "variables": {
+          "added": [{
+            "name": "application_name",
+            "value": "appname2"
+          }],
+          "changed": [{
+            "name": "array_nulls",
+            "value": true
+          },{
+            "name": "search_path",
+            "value": "public, pg_catalog"
+          }]
+        }
+      },
+      "expected_sql_file": "alter_ptrig_set_3.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }, {
+      "type": "create",
+      "name": "Create full fledged trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [{
+          "grantee": "postgres",
+          "grantor": "postgres",
+          "privileges": [
+            {
+              "privilege": true,
+              "privilege_type": "X",
+              "with_grant": true
+            }
+          ]
+        }],
+        "args": [],
+        "description": "some comment",
+        "funcowner": "postgres",
+        "lanname": "plpgsql",
+        "options": [],
+        "procost": "1234",
+        "proisstrict": true,
+        "proiswindow": true,
+        "proleakproof": true,
+        "pronamespace": 2200,
+        "proretset": true,
+        "prorettypename": "trigger",
+        "prorows": "4321",
+        "prosecdef": true,
+        "provolatile": "s",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [{
+          "name": "application_name",
+          "value": "appname"
+        },{
+          "name": "search_path",
+          "value": "public, pg_temp"
+        }],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_plain_trigger_full.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop full fledged trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }, {
+      "type": "create",
+      "name": "Create full fledged event trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [{
+          "grantee": "postgres",
+          "grantor": "postgres",
+          "privileges": [
+            {
+              "privilege": true,
+              "privilege_type": "X",
+              "with_grant": true
+            }
+          ]
+        }],
+        "args": [],
+        "description": "some comment",
+        "funcowner": "postgres",
+        "lanname": "plpgsql",
+        "options": [],
+        "procost": "1234",
+        "proisstrict": true,
+        "proiswindow": true,
+        "proleakproof": true,
+        "pronamespace": 2200,
+        "proretset": true,
+        "prorettypename": "event_trigger",
+        "prorows": "4321",
+        "prosecdef": true,
+        "provolatile": "s",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [{
+          "name": "application_name",
+          "value": "appname"
+        }],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_event_trigger_full.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop full fledged event trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_acl.msql
new file mode 100644
index 0000000..82ce0c5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_acl.msql
@@ -0,0 +1 @@
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_acl.sql
new file mode 100644
index 0000000..100b8f0
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_acl.sql
@@ -0,0 +1,25 @@
+-- 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 postgres;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_parameter.msql
new file mode 100644
index 0000000..ae35deb
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_parameter.msql
@@ -0,0 +1,13 @@
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE
+    PARALLEL UNSAFE
+    COST 100
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_parameter.sql
new file mode 100644
index 0000000..a34ddda
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_add_parameter.sql
@@ -0,0 +1,21 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_comment.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_comment.msql
new file mode 100644
index 0000000..12b3a14
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_comment.msql
@@ -0,0 +1,2 @@
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_comment.sql
new file mode 100644
index 0000000..f87e09b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_comment.sql
@@ -0,0 +1,23 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_acl.msql
new file mode 100644
index 0000000..1393bd7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_acl.msql
@@ -0,0 +1,3 @@
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_acl.sql
new file mode 100644
index 0000000..b189ba6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_acl.sql
@@ -0,0 +1,20 @@
+-- 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_parameter.msql
new file mode 100644
index 0000000..f215838
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_parameter.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RESET application_name;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_parameter.sql
new file mode 100644
index 0000000..cd8074e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_delete_parameter.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_rename.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_rename.msql
new file mode 100644
index 0000000..8ddfca7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_rename.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    RENAME TO "Function3_$%{}[]()&*^!@""'`\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_rename.sql
new file mode 100644
index 0000000..a5c051d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_function_rename.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_comment.sql
new file mode 100644
index 0000000..5f2e770
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_comment.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    VOLATILE NOT LEAKPROOF
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_1.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_1.sql
new file mode 100644
index 0000000..bf48852
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_1.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    STABLE LEAKPROOF STRICT SECURITY DEFINER
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_2.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_2.sql
new file mode 100644
index 0000000..c14baa2
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_2.sql
@@ -0,0 +1,22 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 123
+    IMMUTABLE LEAKPROOF STRICT SECURITY DEFINER
+    SET application_name='appname'
+    SET search_path=public, pg_temp
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_3.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_3.sql
new file mode 100644
index 0000000..7caebc3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/alter_ptrig_set_3.sql
@@ -0,0 +1,23 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 123
+    IMMUTABLE LEAKPROOF STRICT SECURITY DEFINER
+    SET application_name='appname2'
+    SET search_path=public, pg_catalog
+    SET array_nulls='true'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_event_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_event_trigger_full.sql
new file mode 100644
index 0000000..1bdbb6e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_event_trigger_full.sql
@@ -0,0 +1,26 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS SETOF event_trigger
+    LANGUAGE 'plpgsql'
+    COST 1234
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW
+    ROWS 4321
+    SET application_name='appname'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION;
+
+REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function.msql
new file mode 100644
index 0000000..8492738
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function.msql
@@ -0,0 +1,15 @@
+CREATE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(IN param character varying DEFAULT '1')
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function.sql
new file mode 100644
index 0000000..e05adf5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function.sql
@@ -0,0 +1,21 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+
+    COST 100
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW  PARALLEL UNSAFE
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO postgres;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function_for_alter.msql
new file mode 100644
index 0000000..bfb27b3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function_for_alter.msql
@@ -0,0 +1,15 @@
+CREATE 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function_for_alter.sql
new file mode 100644
index 0000000..b189ba6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_function_for_alter.sql
@@ -0,0 +1,20 @@
+-- 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;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_plain_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_plain_trigger.sql
new file mode 100644
index 0000000..191e59c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_plain_trigger.sql
@@ -0,0 +1,17 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    VOLATILE NOT LEAKPROOF
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_plain_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_plain_trigger_full.sql
new file mode 100644
index 0000000..3a51119
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/create_plain_trigger_full.sql
@@ -0,0 +1,27 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS SETOF trigger
+    LANGUAGE 'plpgsql'
+    COST 1234
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW
+    ROWS 4321
+    SET application_name='appname'
+    SET search_path=public, pg_temp
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO postgres;
+
+GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION;
+
+REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/test_function.json
new file mode 100644
index 0000000..43c034d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/test_function.json
@@ -0,0 +1,260 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create function with all options.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function1_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proretset": false,
+        "proisstrict": true,
+        "prosecdef": true,
+        "proiswindow": true,
+        "proparallel": "u",
+        "procost": "100",
+        "prorows": "0",
+        "proleakproof": true,
+        "arguments": [
+          {
+            "argtype": "character varying",
+            "argmode": "IN",
+            "argname": "param",
+            "argdefval": "'1'"
+          }
+        ],
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function.sql",
+      "expected_msql_file": "create_function.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function comment",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "description": "Some comment"
+      },
+      "expected_sql_file": "alter_function_comment.sql",
+      "expected_msql_file": "alter_function_comment.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for alter.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function rename.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name":"Function3_$%{}[]()&*^!@\"'`\\/#"
+      },
+      "expected_sql_file": "alter_function_rename.sql",
+      "expected_msql_file": "alter_function_rename.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function code and add parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "prosrc": "begin\nselect '2';\nend\n",
+        "variables": {
+          "added": [
+            {
+              "name": "application_name",
+              "value": "appname"
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_parameter.sql",
+      "expected_msql_file": "alter_function_add_parameter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function delete parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "variables": {
+          "deleted": [
+            {
+              "name": "application_name",
+              "value": true
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_parameter.sql",
+      "expected_msql_file": "alter_function_delete_parameter.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for acl.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "postgres",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "acl": {
+          "added": [
+            {
+              "grantee": "postgres",
+              "grantor": "postgres",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_acl.sql",
+      "expected_msql_file": "alter_function_add_acl.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "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
+                }
+              ]
+            },
+            {
+              "grantee": "postgres",
+              "grantor": "postgres",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_acl.sql",
+      "expected_msql_file": "alter_function_delete_acl.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/test_trigger_functions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/test_trigger_functions.json
new file mode 100644
index 0000000..a2e9fc7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/9.5_plus/test_trigger_functions.json
@@ -0,0 +1,191 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [],
+        "args": [],
+        "funcowner": "postgres",
+        "lanname": "plpgsql",
+        "options": [],
+        "pronamespace": 2200,
+        "prorettypename": "trigger",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_plain_trigger.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function comment",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "description": "some comment"
+      },
+      "expected_sql_file": "alter_ptrig_comment.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 1 - Strict, Leakproof, Security of definer, Volatility",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "proisstrict": true,
+        "proleakproof": true,
+        "prosecdef": true,
+        "provolatile": "s"
+      },
+      "expected_sql_file": "alter_ptrig_set_1.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 2 - Cost, Volatility, Add Param",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "procost": "123",
+        "provolatile": "i",
+        "variables": {
+          "added": [{
+            "name": "application_name",
+            "value": "appname"
+          },{
+            "name": "search_path",
+            "value": "public, pg_temp"
+          }]
+        }
+      },
+      "expected_sql_file": "alter_ptrig_set_2.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 3 - Add Param, Change Param",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "variables": {
+          "added": [{
+            "name": "application_name",
+            "value": "appname2"
+          }],
+          "changed": [{
+            "name": "array_nulls",
+            "value": true
+          },{
+            "name": "search_path",
+            "value": "public, pg_catalog"
+          }]
+        }
+      },
+      "expected_sql_file": "alter_ptrig_set_3.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }, {
+      "type": "create",
+      "name": "Create full fledged trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [{
+          "grantee": "postgres",
+          "grantor": "postgres",
+          "privileges": [
+            {
+              "privilege": true,
+              "privilege_type": "X",
+              "with_grant": true
+            }
+          ]
+        }],
+        "args": [],
+        "description": "some comment",
+        "funcowner": "postgres",
+        "lanname": "plpgsql",
+        "options": [],
+        "procost": "1234",
+        "proisstrict": true,
+        "proiswindow": true,
+        "proleakproof": true,
+        "pronamespace": 2200,
+        "proretset": true,
+        "prorettypename": "trigger",
+        "prorows": "4321",
+        "prosecdef": true,
+        "provolatile": "s",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [{
+          "name": "application_name",
+          "value": "appname"
+        },{
+          "name": "search_path",
+          "value": "public, pg_temp"
+        }],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_plain_trigger_full.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop full fledged trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }, {
+      "type": "create",
+      "name": "Create full fledged event trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [{
+          "grantee": "postgres",
+          "grantor": "postgres",
+          "privileges": [
+            {
+              "privilege": true,
+              "privilege_type": "X",
+              "with_grant": true
+            }
+          ]
+        }],
+        "args": [],
+        "description": "some comment",
+        "funcowner": "postgres",
+        "lanname": "plpgsql",
+        "options": [],
+        "procost": "1234",
+        "proisstrict": true,
+        "proiswindow": true,
+        "proleakproof": true,
+        "pronamespace": 2200,
+        "proretset": true,
+        "prorettypename": "event_trigger",
+        "prorows": "4321",
+        "prosecdef": true,
+        "provolatile": "s",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [{
+          "name": "application_name",
+          "value": "appname"
+        }],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_event_trigger_full.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop full fledged event trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_acl.msql
new file mode 100644
index 0000000..f5f875c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_acl.msql
@@ -0,0 +1,3 @@
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_acl.sql
new file mode 100644
index 0000000..3ddfbc5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_acl.sql
@@ -0,0 +1,24 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    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;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO enterprisedb;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_parameter.msql
new file mode 100644
index 0000000..900e3a9
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_parameter.msql
@@ -0,0 +1,13 @@
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+
+    COST 100
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_parameter.sql
new file mode 100644
index 0000000..87425c5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_add_parameter.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_comment.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_comment.msql
new file mode 100644
index 0000000..12b3a14
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_comment.msql
@@ -0,0 +1,2 @@
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_comment.sql
new file mode 100644
index 0000000..4831da8
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_comment.sql
@@ -0,0 +1,22 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW PARALLEL SAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
+
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_acl.msql
new file mode 100644
index 0000000..13bb67b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_acl.msql
@@ -0,0 +1,3 @@
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_acl.sql
new file mode 100644
index 0000000..312b0f3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_acl.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_parameter.msql
new file mode 100644
index 0000000..f215838
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_parameter.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RESET application_name;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_parameter.sql
new file mode 100644
index 0000000..442b90b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_delete_parameter.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_rename.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_rename.msql
new file mode 100644
index 0000000..8ddfca7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_rename.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    RENAME TO "Function3_$%{}[]()&*^!@""'`\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_rename.sql
new file mode 100644
index 0000000..6dbfd64
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/alter_function_rename.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function.msql
new file mode 100644
index 0000000..05b6182
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function.msql
@@ -0,0 +1,14 @@
+CREATE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(IN param character varying DEFAULT '1')
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW PARALLEL SAFE
+    COST 100
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function.sql
new file mode 100644
index 0000000..0fd7edb
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW PARALLEL SAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function_for_alter.msql
new file mode 100644
index 0000000..8016eb1
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function_for_alter.msql
@@ -0,0 +1,14 @@
+CREATE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function_for_alter.sql
new file mode 100644
index 0000000..312b0f3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/create_function_for_alter.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/test_function.json
new file mode 100644
index 0000000..a78dc56
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/11_plus/test_function.json
@@ -0,0 +1,272 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create function with all options.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function1_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proretset": false,
+        "proisstrict": true,
+        "prosecdef": true,
+        "proiswindow": true,
+        "proparallel": "s",
+        "procost": "100",
+        "prorows": "0",
+        "proleakproof": true,
+        "arguments": [
+          {
+            "argtype": "character varying",
+            "argmode": "IN",
+            "argname": "param",
+            "argdefval": "'1'"
+          }
+        ],
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function.sql",
+      "expected_msql_file": "create_function.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function comment",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "description": "Some comment"
+      },
+      "expected_sql_file": "alter_function_comment.sql",
+      "expected_msql_file": "alter_function_comment.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for alter.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "prosecdef": true,
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function rename.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function3_$%{}[]()&*^!@\"'`\\/#"
+      },
+      "expected_sql_file": "alter_function_rename.sql",
+      "expected_msql_file": "alter_function_rename.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function code and add parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "prosrc": "begin\nselect '2';\nend\n",
+        "variables": {
+          "added": [
+            {
+              "name": "application_name",
+              "value": "appname"
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_parameter.sql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function delete parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "variables": {
+          "deleted": [
+            {
+              "name": "application_name",
+              "value": true
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_parameter.sql",
+      "expected_msql_file": "alter_function_delete_parameter.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for acl.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "prosecdef": true,
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "acl": {
+          "added": [
+            {
+              "grantee": "PUBLIC",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            },
+            {
+              "grantee": "enterprisedb",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_acl.sql",
+      "expected_msql_file": "alter_function_add_acl.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "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
+                }
+              ]
+            },
+            {
+              "grantee": "enterprisedb",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_acl.sql",
+      "expected_msql_file": "alter_function_delete_acl.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_acl.msql
new file mode 100644
index 0000000..f5f875c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_acl.msql
@@ -0,0 +1,3 @@
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_acl.sql
new file mode 100644
index 0000000..3ddfbc5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_acl.sql
@@ -0,0 +1,24 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    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;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO enterprisedb;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_parameter.msql
new file mode 100644
index 0000000..900e3a9
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_parameter.msql
@@ -0,0 +1,13 @@
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+
+    COST 100
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_parameter.sql
new file mode 100644
index 0000000..87425c5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_add_parameter.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_comment.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_comment.msql
new file mode 100644
index 0000000..12b3a14
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_comment.msql
@@ -0,0 +1,2 @@
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_comment.sql
new file mode 100644
index 0000000..4831da8
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_comment.sql
@@ -0,0 +1,22 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW PARALLEL SAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
+
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_acl.msql
new file mode 100644
index 0000000..13bb67b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_acl.msql
@@ -0,0 +1,3 @@
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_acl.sql
new file mode 100644
index 0000000..312b0f3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_acl.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_parameter.msql
new file mode 100644
index 0000000..f215838
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_parameter.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RESET application_name;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_parameter.sql
new file mode 100644
index 0000000..442b90b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_delete_parameter.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_rename.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_rename.msql
new file mode 100644
index 0000000..8ddfca7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_rename.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    RENAME TO "Function3_$%{}[]()&*^!@""'`\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_rename.sql
new file mode 100644
index 0000000..6dbfd64
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_function_rename.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_comment.sql
new file mode 100644
index 0000000..86eae9a
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_comment.sql
@@ -0,0 +1,15 @@
+-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
+
+-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
+
+CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
+	i1 integer)
+LANGUAGE 'plpgsql'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_comment_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_comment_msql.sql
new file mode 100644
index 0000000..d48fca1
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_comment_msql.sql
@@ -0,0 +1,2 @@
+COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_param.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_param.sql
new file mode 100644
index 0000000..4a8b0b1
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_param.sql
@@ -0,0 +1,16 @@
+-- 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$;
+
+COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_param_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_param_msql.sql
new file mode 100644
index 0000000..52c0f9c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_proc_param_msql.sql
@@ -0,0 +1,2 @@
+ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
+    SET application_name=pgadmin;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_comment.sql
new file mode 100644
index 0000000..477d572
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_comment.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    VOLATILE NOT LEAKPROOF
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_1.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_1.sql
new file mode 100644
index 0000000..91f3b18
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_1.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    STABLE LEAKPROOF STRICT SECURITY DEFINER
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_2.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_2.sql
new file mode 100644
index 0000000..7c7b337
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_2.sql
@@ -0,0 +1,22 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 123
+    IMMUTABLE LEAKPROOF STRICT SECURITY DEFINER
+    SET application_name='appname'
+    SET search_path=public, pg_temp
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_3.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_3.sql
new file mode 100644
index 0000000..f5de419
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/alter_ptrig_set_3.sql
@@ -0,0 +1,23 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 123
+    IMMUTABLE LEAKPROOF STRICT SECURITY DEFINER
+    SET application_name='appname2'
+    SET search_path=public, pg_catalog
+    SET array_nulls='true'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_event_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_event_trigger_full.sql
new file mode 100644
index 0000000..c9dc3d5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_event_trigger_full.sql
@@ -0,0 +1,26 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS SETOF event_trigger
+    LANGUAGE 'plpgsql'
+    COST 1234
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW
+    ROWS 4321
+    SET application_name='appname'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
+
+GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO enterprisedb WITH GRANT OPTION;
+
+REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function.msql
new file mode 100644
index 0000000..05b6182
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function.msql
@@ -0,0 +1,14 @@
+CREATE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(IN param character varying DEFAULT '1')
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW PARALLEL SAFE
+    COST 100
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function.sql
new file mode 100644
index 0000000..0fd7edb
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW PARALLEL SAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function_for_alter.msql
new file mode 100644
index 0000000..8016eb1
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function_for_alter.msql
@@ -0,0 +1,14 @@
+CREATE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function_for_alter.sql
new file mode 100644
index 0000000..312b0f3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_function_for_alter.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_plain_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_plain_trigger.sql
new file mode 100644
index 0000000..99e66f5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_plain_trigger.sql
@@ -0,0 +1,17 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS trigger
+    LANGUAGE 'plpgsql'
+    COST 100
+    VOLATILE NOT LEAKPROOF
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_plain_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_plain_trigger_full.sql
new file mode 100644
index 0000000..d278a44
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_plain_trigger_full.sql
@@ -0,0 +1,27 @@
+-- FUNCTION: public.Trig1_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"();
+
+CREATE FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    RETURNS SETOF trigger
+    LANGUAGE 'plpgsql'
+    COST 1234
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW
+    ROWS 4321
+    SET application_name='appname'
+    SET search_path=public, pg_temp
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
+
+ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
+
+GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO enterprisedb WITH GRANT OPTION;
+
+REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
+    IS 'some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_procedure.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_procedure.sql
new file mode 100644
index 0000000..c6b6482
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/create_procedure.sql
@@ -0,0 +1,12 @@
+-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
+
+-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
+
+CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
+	i1 integer)
+LANGUAGE 'plpgsql'
+AS $BODY$
+begin
+select 1;
+end;
+$BODY$;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_function.json
new file mode 100644
index 0000000..a78dc56
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_function.json
@@ -0,0 +1,272 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create function with all options.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function1_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proretset": false,
+        "proisstrict": true,
+        "prosecdef": true,
+        "proiswindow": true,
+        "proparallel": "s",
+        "procost": "100",
+        "prorows": "0",
+        "proleakproof": true,
+        "arguments": [
+          {
+            "argtype": "character varying",
+            "argmode": "IN",
+            "argname": "param",
+            "argdefval": "'1'"
+          }
+        ],
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function.sql",
+      "expected_msql_file": "create_function.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function comment",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "description": "Some comment"
+      },
+      "expected_sql_file": "alter_function_comment.sql",
+      "expected_msql_file": "alter_function_comment.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for alter.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "prosecdef": true,
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function rename.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function3_$%{}[]()&*^!@\"'`\\/#"
+      },
+      "expected_sql_file": "alter_function_rename.sql",
+      "expected_msql_file": "alter_function_rename.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function code and add parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "prosrc": "begin\nselect '2';\nend\n",
+        "variables": {
+          "added": [
+            {
+              "name": "application_name",
+              "value": "appname"
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_parameter.sql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function delete parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "variables": {
+          "deleted": [
+            {
+              "name": "application_name",
+              "value": true
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_parameter.sql",
+      "expected_msql_file": "alter_function_delete_parameter.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for acl.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "prosecdef": true,
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "acl": {
+          "added": [
+            {
+              "grantee": "PUBLIC",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            },
+            {
+              "grantee": "enterprisedb",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_acl.sql",
+      "expected_msql_file": "alter_function_add_acl.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "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
+                }
+              ]
+            },
+            {
+              "grantee": "enterprisedb",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_acl.sql",
+      "expected_msql_file": "alter_function_delete_acl.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_procedures.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_procedures.json
new file mode 100644
index 0000000..870f400
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_procedures.json
@@ -0,0 +1,58 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create procedure",
+      "endpoint": "NODE-procedure.obj",
+      "sql_endpoint": "NODE-procedure.sql_id",
+      "data": {
+        "name": "Proc1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [],
+        "arguments": [{"argtype": "integer", "argmode": "IN", "argname": "i1", "argdefval": ""}],
+        "funcowner": "enterprisedb",
+        "lanname": "plpgsql",
+        "options": [],
+        "pronamespace": 2200,
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [],
+        "schema": "public",
+        "provolatile": null,
+        "proisstrict": false,
+        "proparallel": null,
+        "procost": null,
+        "proleakproof": false,
+        "probin": "$libdir/"
+      },
+      "expected_sql_file": "create_procedure.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter procedure comment",
+      "endpoint": "NODE-procedure.obj_id",
+      "sql_endpoint": "NODE-procedure.sql_id",
+      "data": {
+        "description": "some comment"
+      },
+      "expected_sql_file": "alter_proc_comment.sql",
+      "expected_msql_file": "alter_proc_comment_msql.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter procedure param",
+      "endpoint": "NODE-procedure.obj_id",
+      "sql_endpoint": "NODE-procedure.sql_id",
+      "data": {
+        "variables": {
+          "added": [{"name": "application_name", "value": "pgadmin"}]
+        }
+      },
+      "expected_sql_file": "alter_proc_param.sql",
+      "expected_msql_file": "alter_proc_param_msql.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop procedure",
+      "endpoint": "NODE-procedure.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_trigger_functions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_trigger_functions.json
new file mode 100644
index 0000000..cc11820
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/12_plus/test_trigger_functions.json
@@ -0,0 +1,191 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [],
+        "args": [],
+        "funcowner": "enterprisedb",
+        "lanname": "plpgsql",
+        "options": [],
+        "pronamespace": 2200,
+        "prorettypename": "trigger",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_plain_trigger.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function comment",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "description": "some comment"
+      },
+      "expected_sql_file": "alter_ptrig_comment.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 1 - Strict, Leakproof, Security of definer, Volatility",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "proisstrict": true,
+        "proleakproof": true,
+        "prosecdef": true,
+        "provolatile": "s"
+      },
+      "expected_sql_file": "alter_ptrig_set_1.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 2 - Cost, Volatility, Add Param",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "procost": "123",
+        "provolatile": "i",
+        "variables": {
+          "added": [{
+            "name": "application_name",
+            "value": "appname"
+          },{
+            "name": "search_path",
+            "value": "public, pg_temp"
+          }]
+        }
+      },
+      "expected_sql_file": "alter_ptrig_set_2.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter trigger function Set 3 - Add Param, Change Param",
+      "endpoint": "NODE-trigger_function.obj_id",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "variables": {
+          "added": [{
+            "name": "application_name",
+            "value": "appname2"
+          }],
+          "changed": [{
+            "name": "array_nulls",
+            "value": true
+          },{
+            "name": "search_path",
+            "value": "public, pg_catalog"
+          }]
+        }
+      },
+      "expected_sql_file": "alter_ptrig_set_3.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }, {
+      "type": "create",
+      "name": "Create full fledged trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [{
+          "grantee": "enterprisedb",
+          "grantor": "enterprisedb",
+          "privileges": [
+            {
+              "privilege": true,
+              "privilege_type": "X",
+              "with_grant": true
+            }
+          ]
+        }],
+        "args": [],
+        "description": "some comment",
+        "funcowner": "enterprisedb",
+        "lanname": "plpgsql",
+        "options": [],
+        "procost": "1234",
+        "proisstrict": true,
+        "proiswindow": true,
+        "proleakproof": true,
+        "pronamespace": 2200,
+        "proretset": true,
+        "prorettypename": "trigger",
+        "prorows": "4321",
+        "prosecdef": true,
+        "provolatile": "s",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [{
+          "name": "application_name",
+          "value": "appname"
+        },{
+          "name": "search_path",
+          "value": "public, pg_temp"
+        }],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_plain_trigger_full.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop full fledged trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }, {
+      "type": "create",
+      "name": "Create full fledged event trigger function",
+      "endpoint": "NODE-trigger_function.obj",
+      "sql_endpoint": "NODE-trigger_function.sql_id",
+      "data": {
+        "name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
+        "acl": [{
+          "grantee": "enterprisedb",
+          "grantor": "enterprisedb",
+          "privileges": [
+            {
+              "privilege": true,
+              "privilege_type": "X",
+              "with_grant": true
+            }
+          ]
+        }],
+        "args": [],
+        "description": "some comment",
+        "funcowner": "enterprisedb",
+        "lanname": "plpgsql",
+        "options": [],
+        "procost": "1234",
+        "proisstrict": true,
+        "proiswindow": true,
+        "proleakproof": true,
+        "pronamespace": 2200,
+        "proretset": true,
+        "prorettypename": "event_trigger",
+        "prorows": "4321",
+        "prosecdef": true,
+        "provolatile": "s",
+        "prosrc": "begin\nselect 1;\nend;",
+        "seclabels": [],
+        "variables": [{
+          "name": "application_name",
+          "value": "appname"
+        }],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_event_trigger_full.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop full fledged event trigger function",
+      "endpoint": "NODE-trigger_function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_acl.msql
new file mode 100644
index 0000000..f5f875c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_acl.msql
@@ -0,0 +1,3 @@
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_acl.sql
new file mode 100644
index 0000000..fa9d2c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_acl.sql
@@ -0,0 +1,24 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+    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;
+
+GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO enterprisedb;
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_parameter.msql
new file mode 100644
index 0000000..900e3a9
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_parameter.msql
@@ -0,0 +1,13 @@
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+
+    COST 100
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_parameter.sql
new file mode 100644
index 0000000..95274fe
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_add_parameter.sql
@@ -0,0 +1,20 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+    COST 100
+    SET application_name='appname'
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_comment.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_comment.msql
new file mode 100644
index 0000000..12b3a14
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_comment.msql
@@ -0,0 +1,2 @@
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_comment.sql
new file mode 100644
index 0000000..6cdd8d6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_comment.sql
@@ -0,0 +1,22 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
+
+COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    IS 'Some comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_acl.msql
new file mode 100644
index 0000000..13bb67b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_acl.msql
@@ -0,0 +1,3 @@
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
+
+REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_acl.sql
new file mode 100644
index 0000000..78941cc
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_acl.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_parameter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_parameter.msql
new file mode 100644
index 0000000..f215838
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_parameter.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    RESET application_name;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_parameter.sql
new file mode 100644
index 0000000..bb15167
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_delete_parameter.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '2';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_rename.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_rename.msql
new file mode 100644
index 0000000..8ddfca7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_rename.msql
@@ -0,0 +1,2 @@
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    RENAME TO "Function3_$%{}[]()&*^!@""'`\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_rename.sql
new file mode 100644
index 0000000..07f562e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/alter_function_rename.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function3_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function.msql
new file mode 100644
index 0000000..05b6182
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function.msql
@@ -0,0 +1,14 @@
+CREATE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(IN param character varying DEFAULT '1')
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW PARALLEL SAFE
+    COST 100
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function.sql
new file mode 100644
index 0000000..c741bde
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function1_$%{}[]()&*^!@"'`\/#(character varying)
+
+-- DROP FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying);
+
+CREATE OR REPLACE FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(
+	param character varying DEFAULT '1'::character varying)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE LEAKPROOF STRICT SECURITY DEFINER WINDOW
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function_for_alter.msql
new file mode 100644
index 0000000..8016eb1
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function_for_alter.msql
@@ -0,0 +1,14 @@
+CREATE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER PARALLEL UNSAFE
+    COST 100
+    SET enable_sort=true
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function_for_alter.sql
new file mode 100644
index 0000000..78941cc
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/create_function_for_alter.sql
@@ -0,0 +1,19 @@
+-- FUNCTION: public.Function2_$%{}[]()&*^!@"'`\/#()
+
+-- DROP FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"();
+
+CREATE OR REPLACE FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"(
+	)
+RETURNS character varying
+    LANGUAGE 'plpgsql'
+    VOLATILE SECURITY DEFINER
+    COST 100
+    SET enable_sort='true'
+AS $BODY$
+begin
+select '1';
+end
+$BODY$;
+
+ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
+    OWNER TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/test_function.json
new file mode 100644
index 0000000..a78dc56
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/ppas/9.6_plus/test_function.json
@@ -0,0 +1,272 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create function with all options.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function1_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proretset": false,
+        "proisstrict": true,
+        "prosecdef": true,
+        "proiswindow": true,
+        "proparallel": "s",
+        "procost": "100",
+        "prorows": "0",
+        "proleakproof": true,
+        "arguments": [
+          {
+            "argtype": "character varying",
+            "argmode": "IN",
+            "argname": "param",
+            "argdefval": "'1'"
+          }
+        ],
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function.sql",
+      "expected_msql_file": "create_function.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function comment",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "description": "Some comment"
+      },
+      "expected_sql_file": "alter_function_comment.sql",
+      "expected_msql_file": "alter_function_comment.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for alter.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "prosecdef": true,
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function rename.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function3_$%{}[]()&*^!@\"'`\\/#"
+      },
+      "expected_sql_file": "alter_function_rename.sql",
+      "expected_msql_file": "alter_function_rename.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function code and add parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "prosrc": "begin\nselect '2';\nend\n",
+        "variables": {
+          "added": [
+            {
+              "name": "application_name",
+              "value": "appname"
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_parameter.sql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function delete parameters.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "variables": {
+          "deleted": [
+            {
+              "name": "application_name",
+              "value": true
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_parameter.sql",
+      "expected_msql_file": "alter_function_delete_parameter.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    },
+    {
+      "type": "create",
+      "name": "Create function for acl.",
+      "endpoint": "NODE-function.obj",
+      "msql_endpoint": "NODE-function.msql",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "name": "Function2_$%{}[]()&*^!@\"'`\\/#",
+        "funcowner": "enterprisedb",
+        "pronamespace": 2200,
+        "prorettypename": "character varying",
+        "lanname": "plpgsql",
+        "provolatile": "v",
+        "proparallel": "u",
+        "prosecdef": true,
+        "arguments": [],
+        "procost": "100",
+        "prosrc": "begin\nselect '1';\nend",
+        "probin": "$libdir/",
+        "options": [],
+        "variables": [
+          {
+            "name": "enable_sort",
+            "value": true
+          }
+        ],
+        "seclabels": [],
+        "acl": [],
+        "schema": "public"
+      },
+      "expected_sql_file": "create_function_for_alter.sql",
+      "expected_msql_file": "create_function_for_alter.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "endpoint": "NODE-function.obj_id",
+      "msql_endpoint": "NODE-function.msql_id",
+      "sql_endpoint": "NODE-function.sql_id",
+      "data": {
+        "acl": {
+          "added": [
+            {
+              "grantee": "PUBLIC",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            },
+            {
+              "grantee": "enterprisedb",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_add_acl.sql",
+      "expected_msql_file": "alter_function_add_acl.msql"
+    },
+    {
+      "type": "alter",
+      "name": "Alter function add acl.",
+      "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
+                }
+              ]
+            },
+            {
+              "grantee": "enterprisedb",
+              "grantor": "enterprisedb",
+              "privileges": [
+                {
+                  "privilege_type": "X",
+                  "privilege": true,
+                  "with_grant": false
+                }
+              ]
+            }
+          ]
+        }
+      },
+      "expected_sql_file": "alter_function_delete_acl.sql",
+      "expected_msql_file": "alter_function_delete_acl.msql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop function",
+      "endpoint": "NODE-function.delete_id",
+      "data": {
+      }
+    }
+  ]
+}
