Hi,
PFA patch to fix the issue in Function, Procedure & Trigger Function
modules where user was not able to update object if user changes the code
definition.
RM#2537
--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.2_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.2_plus/update.sql
index 6f6ba19..9e69a1a 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.2_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.2_plus/update.sql
@@ -29,7 +29,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}({% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}{%
endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{% endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.5_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.5_plus/update.sql
index 402c641..be24303 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.5_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.5_plus/update.sql
@@ -30,7 +30,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}({% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}
{%endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}} {%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.6_plus/create.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.6_plus/create.sql
index 0e2495d..e3e9c18 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.6_plus/create.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.6_plus/create.sql
@@ -17,6 +17,7 @@ CREATE{% if query_type is defined %}{{' OR REPLACE'}}{% endif
%} FUNCTION {{ con
LANGUAGE {{ data.lanname|qtLiteral }}
{% if data.procost %}
+
COST {{data.procost}}
{% endif %}
{% if data.provolatile %}{% if data.provolatile == 'i' %}IMMUTABLE{% elif
data.provolatile == 's' %}STABLE{% else %}VOLATILE{% endif %} {% endif %}{% if
data.proleakproof %}LEAKPROOF {% endif %}
@@ -26,7 +27,9 @@ CREATE{% if query_type is defined %}{{' OR REPLACE'}}{% endif
%} FUNCTION {{ con
{% if data.proparallel and (data.proparallel == 'r' or data.proparallel ==
's') %}
{% if data.proparallel == 'r' %}PARALLEL RESTRICTED{% elif data.proparallel ==
's' %}PARALLEL SAFE{% endif %}{% endif -%}
{% if data.prorows %}
+
ROWS {{data.prorows}}{% endif -%}{% if data.variables %}{% for v in
data.variables %}
+
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor %}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.6_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.6_plus/update.sql
index 1f8f2f9..5c520bc 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.6_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.6_plus/update.sql
@@ -32,7 +32,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}({% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}
{%endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}} {%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/default/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/default/update.sql
index 12f97cb..2114aee 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/default/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/default/update.sql
@@ -28,7 +28,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}({% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS
{{o_data.prorows}}{%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.2_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.2_plus/update.sql
index 6f6ba19..c50e8db 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.2_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.2_plus/update.sql
@@ -29,7 +29,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}({% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}{%
endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{% endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.5_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.5_plus/update.sql
index 402c641..be24303 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.5_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.5_plus/update.sql
@@ -30,7 +30,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}({% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}
{%endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}} {%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.6_plus/create.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.6_plus/create.sql
index 9437085..df1cfce 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.6_plus/create.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.6_plus/create.sql
@@ -23,8 +23,11 @@ CREATE{% if query_type is defined %}{{' OR REPLACE'}}{%
endif %} FUNCTION {{ con
{% if data.proparallel and (data.proparallel == 'r' or data.proparallel ==
's') %}
{% if data.proparallel == 'r' %}PARALLEL RESTRICTED{% elif data.proparallel ==
's' %}PARALLEL SAFE{% endif %}{% endif %}
{% if data.procost %}
+
COST {{data.procost}}{% endif %}{% if data.prorows %}
+
ROWS {{data.prorows}}{% endif -%}{% if data.variables %}{% for v in
data.variables %}
+
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor %}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.6_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.6_plus/update.sql
index 1f8f2f9..5c520bc 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.6_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.6_plus/update.sql
@@ -32,7 +32,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}({% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}
{%endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}} {%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/default/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/default/update.sql
index c247757..a659419 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/default/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/default/update.sql
@@ -28,7 +28,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}({% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS
{{o_data.prorows}}{%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.5_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.5_plus/update.sql
index c70957e..34bb780 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.5_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.5_plus/update.sql
@@ -21,7 +21,7 @@ CREATE OR REPLACE PROCEDURE {{
conn|qtIdent(o_data.pronamespace, name) }}{% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}{%
endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{% endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.6_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.6_plus/update.sql
index ed24678..6c62990 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.6_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.6_plus/update.sql
@@ -23,7 +23,7 @@ CREATE OR REPLACE PROCEDURE {{
conn|qtIdent(o_data.pronamespace, name) }}{% if d
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}{%
endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{% endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/update.sql
index a6ada37..b99eaad 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/update.sql
@@ -24,7 +24,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}()
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}{%
endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{% endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.5_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.5_plus/update.sql
index 259a302..5a07176 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.5_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.5_plus/update.sql
@@ -25,7 +25,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}()
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}
{%endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}} {%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/default/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/default/update.sql
index 24c6950..93e89e9 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/default/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/default/update.sql
@@ -23,7 +23,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}()
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS
{{o_data.prorows}}{%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.2_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.2_plus/update.sql
index 17d0be1..e54a484 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.2_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.2_plus/update.sql
@@ -24,7 +24,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}()
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}{%
endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{% endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.5_plus/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.5_plus/update.sql
index 11f783d..11c54cf 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.5_plus/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.5_plus/update.sql
@@ -25,7 +25,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}()
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS {{o_data.prorows}}
{%endif -%}{% if data.merged_variables %}{% for v in data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}} {%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}
diff --git
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/default/update.sql
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/default/update.sql
index 24c6950..93e89e9 100644
---
a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/default/update.sql
+++
b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/default/update.sql
@@ -23,7 +23,7 @@ CREATE OR REPLACE FUNCTION {{
conn|qtIdent(o_data.pronamespace, name) }}()
{% if data.procost %}COST {{data.procost}}{% elif o_data.procost %}COST
{{o_data.procost}}{% endif %}{% if data.prorows %}
- ROWS {{data.prorows}}{% elif o_data.prorows %}ROWS
{{o_data.prorows}}{%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
+ ROWS {{data.prorows}}{% elif o_data.prorows and o_data.prorows != '0' %}
ROWS {{o_data.prorows}}{%endif -%}{% if data.merged_variables %}{% for v in
data.merged_variables %}
SET {{ conn|qtIdent(v.name) }}={{ v.value|qtLiteral }}{% endfor -%}
{% endif %}