From a17aa212f012f93e6acec644c53fa9f0dd774bdd Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Mon, 6 Aug 2018 11:54:25 +0530 Subject: [PATCH] COST statement should not be automatically duplicated after creating trigger function. Fixes #3526 --- docs/en_US/release_notes_3_2.rst | 1 + .../templates/trigger_function/pg/sql/9.2_plus/create.sql | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en_US/release_notes_3_2.rst b/docs/en_US/release_notes_3_2.rst index f78fef775..0b451ec55 100644 --- a/docs/en_US/release_notes_3_2.rst +++ b/docs/en_US/release_notes_3_2.rst @@ -34,4 +34,5 @@ Bug fixes | `Bug #3457 `_ - Fix debugging of procedures in EPAS packages. | `Bug #3468 `_ - Support SSH tunneling with keys that don't have a passphrase. | `Bug #3471 `_ - Ensure the SSH tunnel port number is honoured. +| `Bug #3526 `_ - COST statement should not be automatically duplicated after creating trigger function. | `Bug #3527 `_ - View Data->Filtered Rows dialog should be displayed. \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/create.sql index 922129a95..6e929ce2c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/create.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/create.sql @@ -12,9 +12,8 @@ CREATE FUNCTION {{ conn|qtIdent(data.pronamespace, data.name) }}() {% if data.provolatile %}{% if data.provolatile == 'i' %}IMMUTABLE{% elif data.provolatile == 's' %}STABLE{% else %}VOLATILE{% endif %} {% endif %}{% if data.proleakproof %}LEAKPROOF {% else %}NOT LEAKPROOF {% endif %} {% if data.proisstrict %}STRICT {% endif %} {% if data.prosecdef %}SECURITY DEFINER {% endif %} -{% if data.proiswindow %}WINDOW{% endif %}{% if data.procost %} - - COST {{data.procost}}{% endif %}{% if data.prorows and (data.prorows | int) > 0 %} +{% if data.proiswindow %}WINDOW{% endif %} +{% if data.prorows and (data.prorows | int) > 0 %} ROWS {{data.prorows}}{% endif -%}{% if data.variables %}{% for v in data.variables %}