pgAdmin 4 commit: Attempt to ensure the runtime is built with the corre

2018-02-20 Thread Dave Page
Attempt to ensure the runtime is built with the correct Python version.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8148a61279d453eb78209105275295364430a241

Modified Files
--
ci/build_runtime_qt4.sh | 8 +++-
ci/build_runtime_qt5.sh | 8 +++-
2 files changed, 14 insertions(+), 2 deletions(-)



Build failed in Jenkins: pgadmin4-master-python35 #485

2018-02-20 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Attempt to ensure the runtime is built with the correct Python 
version.

--
[...truncated 494.78 KB...]
copying images... [ 27%] images/resource_group_sql.png
copying images... [ 27%] images/change_user_password.png
copying images... [ 28%] images/tablespace_parameters.png
copying images... [ 28%] images/foreign_key_sql.png
copying images... [ 28%] images/grant_wizard_step1.png
copying images... [ 29%] images/preferences_paths_help.png
copying images... [ 29%] images/rule_general.png
copying images... [ 29%] images/debug_stack.png
copying images... [ 30%] images/debug_ic_step_in.png
copying images... [ 30%] images/trigger_function_sql.png
copying images... [ 30%] images/server_ssl.png
copying images... [ 31%] images/column_variables.png
copying images... [ 31%] images/fts_configuration_definition.png
copying images... [ 31%] images/type_security.png
copying images... [ 32%] images/role_general.png
copying images... [ 32%] images/fts_parser_sql.png
copying images... [ 32%] images/restore_miscellaneous.png
copying images... [ 33%] images/pgagent_schedule_exceptions.png
copying images... [ 33%] images/import_export_complete.png
copying images... [ 33%] images/pgadmin_login.png
copying images... [ 34%] images/collation_definition.png
copying images... [ 34%] images/query_tool.png
copying images... [ 34%] images/query_tool_connection_status.png
copying images... [ 35%] images/table_sql.png
copying images... [ 35%] images/materialized_view_general.png
copying images... [ 35%] images/pgagent_schedule_definition.png
copying images... [ 36%] images/foreign_server_general.png
copying images... [ 36%] images/column_security.png
copying images... [ 36%] images/package_sql.png
copying images... [ 37%] images/fts_dictionary_definition.png
copying images... [ 37%] images/foreign_table_security.png
copying images... [ 37%] images/rule_definition.png
copying images... [ 38%] images/main_dashboard.png
copying images... [ 38%] images/restore_process_watcher.png
copying images... [ 38%] images/domain_security.png
copying images... [ 39%] images/help_menu.png
copying images... [ 39%] images/function_options.png
copying images... [ 40%] images/preferences_misc_user_language.png
copying images... [ 40%] images/database_parameters.png
copying images... [ 40%] images/fts_parser_definition.png
copying images... [ 41%] images/preferences_sql_results_grid.png
copying images... [ 41%] images/main_properties_icons.png
copying images... [ 41%] images/foreign_table_sql.png
copying images... [ 42%] images/index_definition.png
copying images... [ 42%] images/backup_server_messages.png
copying images... [ 42%] images/role_security.png
copying images... [ 43%] images/table_foreign_key.png
copying images... [ 43%] images/sequence_general.png
copying images... [ 43%] images/trigger_function_options.png
copying images... [ 44%] images/exclusion_constraint_definition.png
copying images... [ 44%] images/foreign_key_definition.png
copying images... [ 44%] images/fts_template_general.png
copying images... [ 45%] images/user_mapping_sql.png
copying images... [ 45%] images/preferences_sql_options.png
copying images... [ 45%] images/primary_key_definition.png
copying images... [ 46%] images/sequence_security.png
copying images... [ 46%] images/foreign_key_columns.png
copying images... [ 46%] images/view_security.png
copying images... [ 47%] images/backup_server_process_watcher.png
copying images... [ 47%] images/debug_set_breakpoint.png
copying images... [ 47%] images/index_sql.png
copying images... [ 48%] images/logo-right-128.png
copying images... [ 48%] images/backup_messages.png
copying images... [ 48%] images/unique_constraint_general.png
copying images... [ 49%] images/exclusion_constraint_general.png
copying images... [ 49%] images/debug_toolbar.png
copying images... [ 49%] images/database_general.png
copying images... [ 50%] images/ce_error_hba.png
copying images... [ 50%] images/package_general.png
copying images... [ 50%] images/procedure_sql.png
copying images... [ 51%] images/view_general.png
copying images... [ 51%] images/grant_wizard_step2.png
copying images... [ 51%] images/backup_miscellaneous.png
copying images... [ 52%] images/user_mapping_options.png
copying images... [ 52%] images/debug_step_in.png
copying images... [ 52%] images/backup_globals_messages.png
copying images... [ 53%] images/rule_sql.png
copying images... [ 53%] images/fts_dictionary_options.png
copying images... [ 53%] images/add_pgadmin_user.png
copying images... [ 54%] images/role_sql.png
copying images... [ 54%] images/foreign_key_action.png
copying images... [ 54%] images/procedure_security.png
copying images... [ 55%] images/foreign_table_definition.png
copying images... [ 55%] images/debug_variables.png
copying images... [ 55%] images/backup_sections.png
copying images... [ 56%] images/import_export_p

pgAdmin 4 commit: Fix silly typo

2018-02-20 Thread Dave Page
Fix silly typo

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=3021060a32be8b7ff67ccce337e05aeeff6407b4

Modified Files
--
ci/build_runtime_qt4.sh | 2 +-
ci/build_runtime_qt5.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



Jenkins build is back to normal : pgadmin4-master-python35 #486

2018-02-20 Thread pgAdmin 4 Jenkins
See 





RM2983: Fix transient error after application restart

2018-02-20 Thread Harshal Dhumal
Hi,

Please find patch to fix specified_version_number ValueError issue.

Now we try to restore server details like server version number and version
string
from flask session in-case if there was a application restart.

-- 
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py b/web/pgadmin/utils/driver/psycopg2/__init__.py
index 5acfb32..81442e4 100644
--- a/web/pgadmin/utils/driver/psycopg2/__init__.py
+++ b/web/pgadmin/utils/driver/psycopg2/__init__.py
@@ -1752,6 +1752,8 @@ class ServerManager(object):
 
 res = dict()
 res['sid'] = self.sid
+res['ver'] = self.ver
+res['sversion'] = self.sversion
 if hasattr(self, 'password') and self.password:
 # If running under PY2
 if hasattr(self.password, 'decode'):
@@ -1861,6 +1863,20 @@ WHERE db.oid = {0}""".format(did))
 Helps restoring to reconnect the auto-connect connections smoothly on
 reload/restart of the app server..
 """
+# restore server version from flask session if flask server was
+# restarted. As we need server version to resolve sql template paths.
+
+self.ver = data.get('ver', None)
+self.sversion = data.get('sversion', None)
+
+if self.ver and not self.server_type:
+from pgadmin.browser.server_groups.servers.types import ServerType
+for st in ServerType.types():
+if st.instanceOf(self.ver):
+self.server_type = st.stype
+self.server_cls = st
+break
+
 # Hmm.. we will not honour this request, when I already have
 # connections
 if len(self.connections) != 0:
@@ -1967,6 +1983,7 @@ WHERE db.oid = {0}""".format(did))
 else:
 managers[self.sid] = updated_mgr
 session['__pgsql_server_managers'] = managers
+session.force_write = True
 
 def utility(self, operation):
 """


pgAdmin 4 commit: Ensure column names on indexes on views are properly

2018-02-20 Thread Dave Page
Ensure column names on indexes on views are properly quoted in RE-SQL. Fixes 
#3066

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=9a498c2877521d7f49fbaf878678fe6306ae1597
Author: Khushboo Vashi 

Modified Files
--
.../browser/server_groups/servers/databases/schemas/views/__init__.py   | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Re: [pgAdmin4][Patch]: RM #3066 - Create script doesn't add quotation marks to column names for the "add index" functions

2018-02-20 Thread Dave Page
Thanks, applied.

On Mon, Feb 19, 2018 at 1:27 PM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

>
>
> On Mon, Feb 19, 2018 at 5:19 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Mon, Feb 19, 2018 at 7:56 AM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached patch to fix RM #3066 -  Create script doesn't
>>> add quotation marks to column names for the "add index" functions
>>>
>>
>> This causes additional quoting on regular tables. Please see the
>> generated SQL for the index below:
>>
>> Please find the attached updated patch.
>
>
>> -- Table: public."CamelCase"
>>
>> -- DROP TABLE public."CamelCase";
>>
>> CREATE TABLE public."CamelCase"
>> (
>> "ID" bigint NOT NULL DEFAULT nextval('"CamelCase_ID_seq"'::regclass),
>> "SomeColumn" text COLLATE pg_catalog."default",
>> b boolean,
>> CONSTRAINT "CamelCase_pkey" PRIMARY KEY ("ID")
>> )
>> WITH (
>> OIDS = FALSE
>> )
>> TABLESPACE pg_default;
>>
>> ALTER TABLE public."CamelCase"
>> OWNER to postgres;
>>
>> -- Index: MixedCase_IDX
>>
>> -- DROP INDEX public."MixedCase_IDX";
>>
>> CREATE INDEX "MixedCase_IDX"
>> ON public."CamelCase" USING btree
>> ("""ID""")
>> TABLESPACE pg_default;
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgAdmin 4 commit: Fix alignment issues in keyboard shortcut options. Fi

2018-02-20 Thread Dave Page
Fix alignment issues in keyboard shortcut options. Fixes #3080

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=c91a597df9deb0a6017c175305c1cb2f462bfa00
Author: Harshal Dhumal 

Modified Files
--
web/pgadmin/browser/__init__.py|  4 ++--
web/pgadmin/tools/debugger/__init__.py | 13 ++---
2 files changed, 8 insertions(+), 9 deletions(-)



Re: [pgadmin4][patch] Hides the tablespace node in ACI tree for GreenPlum

2018-02-20 Thread Joao De Almeida Pereira
Hello Dave,
No there is only tests around the the backendsupport function

Thanks
Joao

On Mon, Feb 19, 2018 at 6:08 AM Dave Page  wrote:

> Hi
>
> On Mon, Feb 12, 2018 at 6:30 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Hackers
>>
>> The attached patch implements the feature #3107 to hide the tablespaces
>> on GreenPlum databases.
>>
>
> Did you accidentally include some keyboard shortcut test code in this
> patch?
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: RM3080 Fix for alignment issue in keyboard preferences

2018-02-20 Thread Dave Page
Thanks, patch applied.

On Tue, Feb 20, 2018 at 6:16 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find attached patch to fix alignment issue in keyboard preferences.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: RM2898 Keyboard navigation in dialog tabs (nav tabs)

2018-02-20 Thread Dave Page
Hi

On Tue, Feb 20, 2018 at 7:22 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find attached patch to enable keyboard navigation in dialog.
>
> To allow navigation from one tab pane (bootstrap tab pane) to another one
> I have added two new shortcut preferences *Dialog tab previous *(
> shift+control+[ ) and *Dialog tab next* ( shift+control+] ) for backward
> and forward tab navigation.
>
> Also all dialog controls (within same tab pane) can be navigated using TAB
> key.
>

This seems unreliable to me - for example, it keeps getting stuck on the
connection tab on the server properties dialog.

Also, can we use the same wording as for the tabbed panel navigation
please? E.g. Next/Previous instead of Forward/Back.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin4][patch] Hides the tablespace node in ACI tree for GreenPlum

2018-02-20 Thread Dave Page
Hi

On Tue, Feb 20, 2018 at 4:51 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Dave,
> No there is only tests around the the backendsupport function
>

Let me rephrase :-). What's this part of the patch for?

--- a/web/pgadmin/feature_tests/keyboard_shortcut_test.py
+++ b/web/pgadmin/feature_tests/keyboard_shortcut_test.py
@@ -7,9 +7,10 @@
 #
 ##

-import os
-import json
+from __future__ import print_function
 import time
+import sys
+
 from selenium.webdriver.support.ui import WebDriverWait
 from selenium.webdriver.support import expected_conditions as EC
 from selenium.webdriver.common.by import By
@@ -64,6 +65,8 @@ class KeyboardShortcutFeatureTest(BaseFeatureTest):
 Keys.ALT
 ).perform()

+print("Executing shortcut: " +
self.new_shortcuts[s]['locator'] + "...", file=sys.stderr, end="")
+
 self.wait.until(
 EC.presence_of_element_located(
 (By.XPATH, "//li[contains(@id, " +
@@ -76,6 +79,8 @@ class KeyboardShortcutFeatureTest(BaseFeatureTest):

 assert is_open is True, "Keyboard shortcut change is
unsuccessful."

+print("OK", file=sys.stderr)
+


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin4][patch] Hides the tablespace node in ACI tree for GreenPlum

2018-02-20 Thread Joao De Almeida Pereira
Hello,
It is to make it clear which shortcut test is failing, something similar to
the query tool tests.

If you want I can separate those in 2 separate patches

Thanks
Joao

On Tue, Feb 20, 2018 at 12:05 PM Dave Page  wrote:

> Hi
>
> On Tue, Feb 20, 2018 at 4:51 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Dave,
>> No there is only tests around the the backendsupport function
>>
>
> Let me rephrase :-). What's this part of the patch for?
>
> --- a/web/pgadmin/feature_tests/keyboard_shortcut_test.py
> +++ b/web/pgadmin/feature_tests/keyboard_shortcut_test.py
> @@ -7,9 +7,10 @@
>  #
>  ##
>
> -import os
> -import json
> +from __future__ import print_function
>  import time
> +import sys
> +
>  from selenium.webdriver.support.ui import WebDriverWait
>  from selenium.webdriver.support import expected_conditions as EC
>  from selenium.webdriver.common.by import By
> @@ -64,6 +65,8 @@ class KeyboardShortcutFeatureTest(BaseFeatureTest):
>  Keys.ALT
>  ).perform()
>
> +print("Executing shortcut: " +
> self.new_shortcuts[s]['locator'] + "...", file=sys.stderr, end="")
> +
>  self.wait.until(
>  EC.presence_of_element_located(
>  (By.XPATH, "//li[contains(@id, " +
> @@ -76,6 +79,8 @@ class KeyboardShortcutFeatureTest(BaseFeatureTest):
>
>  assert is_open is True, "Keyboard shortcut change is
> unsuccessful."
>
> +print("OK", file=sys.stderr)
> +
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


pgAdmin 4 commit: Fix intermittent specified_version_number ValueError

2018-02-20 Thread Dave Page
Fix intermittent specified_version_number ValueError issue on restart. Fixes 
#2983

Now we try to restore server details like server version number at restart so 
template paths can be resolved.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=05e91044c77a2b87bc95e85b682b0b4ada02322e
Author: Harshal Dhumal 

Modified Files
--
web/pgadmin/utils/driver/psycopg2/__init__.py | 17 +
1 file changed, 17 insertions(+)



Re: RM2983: Fix transient error after application restart

2018-02-20 Thread Dave Page
Thanks, patch applied.

On Tue, Feb 20, 2018 at 12:30 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find patch to fix specified_version_number ValueError issue.
>
> Now we try to restore server details like server version number and
> version string
> from flask session in-case if there was a application restart.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgAdmin 4 commit: Clarify which shortcut is being tested in the shortcu

2018-02-20 Thread Dave Page
Clarify which shortcut is being tested in the shortcut test.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=bcb6f37d6f8e6aed4e433d1efb3d76efd14aee31
Author: Joao Pedro De Almeida Pereira 

Modified Files
--
web/pgadmin/feature_tests/keyboard_shortcut_test.py | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Hide tablespace node on GPDB. Fixes #3107

2018-02-20 Thread Dave Page
Hide tablespace node on GPDB. Fixes #3107

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=ba70634e5f4bcd952facf68c0f4d39a651867c67
Author: Joao Pedro De Almeida Pereira 

Modified Files
--
.../server_groups/servers/tablespaces/__init__.py  |  4 ++
.../tablespaces/tests/test_backend_supported.py| 46 ++
2 files changed, 50 insertions(+)



Re: [pgadmin4][patch] Hides the tablespace node in ACI tree for GreenPlum

2018-02-20 Thread Dave Page
Hi

On Tue, Feb 20, 2018 at 5:16 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello,
> It is to make it clear which shortcut test is failing, something similar
> to the query tool tests.
>

Ah.


>
> If you want I can separate those in 2 separate patches
>

No need - I committed them independently.

Thanks!


>
> Thanks
> Joao
>
> On Tue, Feb 20, 2018 at 12:05 PM Dave Page  wrote:
>
>> Hi
>>
>> On Tue, Feb 20, 2018 at 4:51 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hello Dave,
>>> No there is only tests around the the backendsupport function
>>>
>>
>> Let me rephrase :-). What's this part of the patch for?
>>
>> --- a/web/pgadmin/feature_tests/keyboard_shortcut_test.py
>> +++ b/web/pgadmin/feature_tests/keyboard_shortcut_test.py
>> @@ -7,9 +7,10 @@
>>  #
>>  ###
>> ###
>>
>> -import os
>> -import json
>> +from __future__ import print_function
>>  import time
>> +import sys
>> +
>>  from selenium.webdriver.support.ui import WebDriverWait
>>  from selenium.webdriver.support import expected_conditions as EC
>>  from selenium.webdriver.common.by import By
>> @@ -64,6 +65,8 @@ class KeyboardShortcutFeatureTest(BaseFeatureTest):
>>  Keys.ALT
>>  ).perform()
>>
>> +print("Executing shortcut: " + self.new_shortcuts[s]['locator']
>> + "...", file=sys.stderr, end="")
>> +
>>  self.wait.until(
>>  EC.presence_of_element_located(
>>  (By.XPATH, "//li[contains(@id, " +
>> @@ -76,6 +79,8 @@ class KeyboardShortcutFeatureTest(BaseFeatureTest):
>>
>>  assert is_open is True, "Keyboard shortcut change is
>> unsuccessful."
>>
>> +print("OK", file=sys.stderr)
>> +
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Regarding PEP-8 checker

2018-02-20 Thread Murtuza Zabuawala
Hi All,

Earlier we have fixed PEP-8 issues in below modules,
pycodestyle --config=.pycodestyle ./pgadmin/tools/
pycodestyle --config=.pycodestyle ./pgadmin/utils/
pycodestyle --config=.pycodestyle ./pgadmin/misc/
pycodestyle --config=.pycodestyle ./pgadmin/about/
pycodestyle --config=.pycodestyle ./pgadmin/dashboard/
pycodestyle --config=.pycodestyle ./pgadmin/feature_tests/
pycodestyle --config=.pycodestyle ./regression/
pycodestyle --config=.pycodestyle ./pgadmin/setup/
pycodestyle --config=.pycodestyle ./pgadmin/settings/
pycodestyle --config=.pycodestyle ./pgadmin/redirects/
pycodestyle --config=.pycodestyle ./pgadmin/preferences/
pycodestyle --config=.pycodestyle ./pgadmin/model/
pycodestyle --config=.pycodestyle ./pgadmin/help/


But today when I ran PEP-8 checker on above modules I see many PEP-8 errors
:(

It's a humble request to you to run PEP-8 checker on your changes (If you
have made changes in any of above mentioned modules), so that we don't
waste our efforts in the same modules again and again.


Thanks,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


[pgAdmin4][Patch]: RM #3077 - ERROR: invalid byte sequence for encoding "LATIN1":0x00

2018-02-20 Thread Khushboo Vashi
Hi,

Please find the attached patch to fix RM #3077 : ERROR: invalid byte
sequence for encoding "LATIN1":0x00

Thanks,
Khushboo
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/trigger/sql/10_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/trigger/sql/10_plus/properties.sql
index bd37378..28d10ad 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/trigger/sql/10_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/trigger/sql/10_plus/properties.sql
@@ -3,7 +3,7 @@ SELECT t.oid,t.tgname AS name, t.xmin, t.*, relname, CASE WHEN relkind = 'r' THE
 COALESCE(substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE PROCEDURE'),
 substring(pg_get_triggerdef(t.oid), 'WHEN (.*)  \\$trigger')) AS whenclause,
 -- We need to convert tgargs column bytea datatype to array datatype
-(string_to_array(encode(tgargs, 'escape'), '\000')::text[])[1:tgnargs] AS custom_tgargs,
+(string_to_array(encode(tgargs, 'escape'), E'\\000')::text[])[1:tgnargs] AS custom_tgargs,
 {% if datlastsysoid %}
 (CASE WHEN t.oid <= {{ datlastsysoid}}::oid THEN true ElSE false END) AS is_sys_trigger,
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/trigger/sql/default/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/trigger/sql/default/properties.sql
index 8b3ddc1..2d34acc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/trigger/sql/default/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/trigger/sql/default/properties.sql
@@ -3,7 +3,7 @@ SELECT t.oid,t.tgname AS name, t.xmin, t.*, relname, CASE WHEN relkind = 'r' THE
 COALESCE(substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE PROCEDURE'),
 substring(pg_get_triggerdef(t.oid), 'WHEN (.*)  \\$trigger')) AS whenclause,
 -- We need to convert tgargs column bytea datatype to array datatype
-(string_to_array(encode(tgargs, 'escape'), '\000')::text[])[1:tgnargs] AS custom_tgargs,
+(string_to_array(encode(tgargs, 'escape'), E'\\000')::text[])[1:tgnargs] AS custom_tgargs,
 {% if datlastsysoid %}
 (CASE WHEN t.oid <= {{ datlastsysoid}}::oid THEN true ElSE false END) AS is_sys_trigger,
 {% endif %}