[pgAdmin4][PATCH] To fix the issue in column module

2017-06-22 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue where in column node we were not displaying
column's default value properly, for example if the default value is zero.
RM#1860

I have also fixed similar issue in foreign table module.

Please review.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql
index d055de0..e751c7f 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql
@@ -8,7 +8,7 @@ CREATE FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) 
}}(
 {% for o in c.coloptions %}{% if o.option and o.value %}
 {% if loop.first %} OPTIONS ({% endif %}{% if not loop.first %}, {% endif 
%}{{o.option}} {{o.value|qtLiteral}}{% if loop.last %}){% endif %}{% endif %}
 {% endfor %}{% endif %}{% if c.attnotnull %}
- NOT NULL{% else %} NULL{% endif %}{% if c.typdefault %}
+ NOT NULL{% else %} NULL{% endif %}{% if c.typdefault is defined and 
c.typdefault is not none %}
  DEFAULT {{c.typdefault}}{% endif %}{% if c.collname %}
  COLLATE {{c.collname}}{% endif %}
 {% if not loop.last %},
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql
index 8b85b90..ae01782 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql
@@ -29,7 +29,7 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
 {% if loop.first %} OPTIONS ({% endif %}{% if not loop.first %}, {% endif 
%}{{o.option}} {{o.value|qtLiteral}}{% if loop.last %}){% endif %}{% endif %}
 {% endfor %}{% endif %}
 {% if c.attnotnull %} NOT NULL{% else %} NULL{% endif %}
-{% if c.typdefault %} DEFAULT {{c.typdefault}}{% endif %}
+{% if c.typdefault is defined and c.typdefault is not none %} DEFAULT 
{{c.typdefault}}{% endif %}
 {% if c.collname %} COLLATE {{c.collname}}{% endif %};
 {% endfor -%}
 {% for c in data.columns.changed %}
@@ -51,10 +51,10 @@ c.precision != o_data['columns'][c.attnum]['precision'] %}
 ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
 ALTER COLUMN {{conn|qtIdent(col_name)}} TYPE {{ 
conn|qtTypeIdent(c.datatype) }}{% if c.typlen %}({{c.typlen}}{% if c.precision 
%}, {{c.precision}}{% endif %}){% endif %}{% if c.isArrayType %}[]{% endif %};
 {% endif %}
-{% if c.typdefault != o_data['columns'][c.attnum]['typdefault'] %}
+{% if c.typdefault is defined and c.typdefault != 
o_data['columns'][c.attnum]['typdefault'] %}
 
 ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
-ALTER COLUMN {{conn|qtIdent(col_name)}}{% if c.typdefault %} SET DEFAULT 
{{c.typdefault}}{% else %} DROP DEFAULT{% endif %};
+ALTER COLUMN {{conn|qtIdent(col_name)}}{% if c.typdefault is defined and 
c.typdefault != '' %} SET DEFAULT {{c.typdefault}}{% else %} DROP DEFAULT{% 
endif %};
 {% endif %}
 {% if c.attstattarget != o_data['columns'][c.attnum]['attstattarget'] %}
 
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql
index bccebd4..59250fe 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql
@@ -12,7 +12,7 @@ CREATE FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) 
}}(
 {% if loop.first %} OPTIONS ({% endif %}{% if not loop.first %}, {% endif 
%}{{o.option}} {{o.value|qtLiteral}}{% if loop.last %}){% endif %}{% endif %}
 {% endfor %}{% endif %}
 {% if c.attnotnull %} NOT NULL{% else %} NULL{% endif %}
-{% if c.typdefault %} DEFAULT {{c.typdefault}}{% endif %}
+{% if c.typdefault is defined and c.typdefault is not none %} DEFAULT 
{{c.typdefault}}{% endif %}
 {% if c.collname %} COLLATE {{c.collname}}{% endif %}
 {% if not loop.last %},
 {% endif %}
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/update.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/for

Re: [pgadmin-hackers] [Design update] Style guide for pgAdmin4

2017-06-22 Thread Dave Page
Looks nice.

On Wed, Jun 21, 2017 at 10:34 PM, Shirley Wang  wrote:

> Hi all,
>
> We've updated the borders around alerts so that they are more prominent.
>
> [image: error alert (1).png]
> [image: success alert (2).png]
> [image: Neutral alert.png]
> Everything else stays the same. Let me know your thoughts if any.
>
> Shirley & Shruti
>
> On Wed, May 31, 2017 at 3:02 PM Shirley Wang  wrote:
>
>> On Wed, May 31, 2017 at 11:55 AM Dave Page  wrote:
>>
>>> On Wed, May 31, 2017 at 2:27 PM, Shirley Wang  wrote:
>>>

> When you say "icon" here, are you talking about the combo box arrow,
> or icons on the items themselves? The latter are often useful if you have
> items of different types in the same list.
>
> I think we should have the combo box arrow, to show the user they
> don't have to type if they don't want to.
>

 I'm talking about the combo box arrow. I think that's fine, but in that
 case users shouldn't be able type, they should only be able to select from
 a group of options, like this:

 [image: options.png]
 From what I understand, the text field where a user can type in is for
 searching through options available to them. If we know that people tend to
 search by typing more than scrolling, we should use the precedent for type
 ahead dropdowns .

>>>
>>> We are using a much older precedent - one used in Windows for 20+ years
>>> (possibly other OSs too).
>>>
>>> Remember that some of these combo boxes contain values that are specific
>>> to the database object - the user may not know what to start typing, so the
>>> arrow gives them a hint that they can get a list by clicking - or they can
>>> type.
>>>
>>> The real difference here is that we also include the x to allow the box
>>> to be cleared, where Windows would add a blank option as the first thing in
>>> the list typically.
>>>
>>>
>> I see. It feels like we're at a standstill as to which precedent to use
>> and neither of us is wrong. This might be a good candidate for user
>> testing. We can see how people are using the x as well as learn more about
>> typing / selecting an option behavior.
>>
>> I believe there are some dropdowns in the partition design we can use to
>> test. If it doesn't make sense there, I'm fine putting this in the back
>> burner until there is a good workflow to test it.
>>
>


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

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


Re: [pgAdmin4][Patch]: Fixed #2487: get_preference() uses a synchronous AJAX request

2017-06-22 Thread Murtuza Zabuawala
Hi Khusboo,

Looks like given change have broken Backup, Restore, Import/Export &
Maintenance, even if I have binary path set it is throwing an error.

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

On Wed, Jun 21, 2017 at 9:40 PM, Dave Page  wrote:

> Thanks, patch applied!
>
> On Wed, Jun 21, 2017 at 12:44 PM, Khushboo Vashi
>  wrote:
> > Hi,
> >
> > Please find attached patch to fix RM #2487: get_preference() uses a
> > synchronous AJAX request.
> >
> > Introduced the client side caching for preferences to get rid of
> synchronous
> > AJAX request.
> >
> >
> > Thanks,
> > Khushboo
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


Re: [pgAdmin4][Patch]: Fixed #2487: get_preference() uses a synchronous AJAX request

2017-06-22 Thread Dave Page
Hmm, yes - and it's not giving the normal error instructing the user
to set the path, but another one: "Failed to load preference
pg_bin_dir of module paths".

Khushboo, can you investigate and fix ASAP please?

On Thu, Jun 22, 2017 at 9:31 AM, Murtuza Zabuawala
 wrote:
> Hi Khusboo,
>
> Looks like given change have broken Backup, Restore, Import/Export &
> Maintenance, even if I have binary path set it is throwing an error.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Wed, Jun 21, 2017 at 9:40 PM, Dave Page  wrote:
>>
>> Thanks, patch applied!
>>
>> On Wed, Jun 21, 2017 at 12:44 PM, Khushboo Vashi
>>  wrote:
>> > Hi,
>> >
>> > Please find attached patch to fix RM #2487: get_preference() uses a
>> > synchronous AJAX request.
>> >
>> > Introduced the client side caching for preferences to get rid of
>> > synchronous
>> > AJAX request.
>> >
>> >
>> > Thanks,
>> > Khushboo
>>
>>
>>
>> --
>> 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



[pgAdmin4][Patch][RM_2191] : Add support for the hostaddr connection parameter

2017-06-22 Thread Atul Sharma
Hi,

Please find attached patch for RM #2191 : Add support for hostaddr
connection parameter

Thanks,
Atul


RM_2191.patch
Description: Binary data


Re: [pgAdmin4][Patch]: Fixed #2487: get_preference() uses a synchronous AJAX request

2017-06-22 Thread Khushboo Vashi
Hi,

Please find the attached fix for the same.

Thanks,
Khushboo

On Thu, Jun 22, 2017 at 2:18 PM, Dave Page  wrote:

> Hmm, yes - and it's not giving the normal error instructing the user
> to set the path, but another one: "Failed to load preference
> pg_bin_dir of module paths".
>
> Khushboo, can you investigate and fix ASAP please?
>
> On Thu, Jun 22, 2017 at 9:31 AM, Murtuza Zabuawala
>  wrote:
> > Hi Khusboo,
> >
> > Looks like given change have broken Backup, Restore, Import/Export &
> > Maintenance, even if I have binary path set it is throwing an error.
> >
> > --
> > Regards,
> > Murtuza Zabuawala
> > EnterpriseDB: http://www.enterprisedb.com
> > The Enterprise PostgreSQL Company
> >
> > On Wed, Jun 21, 2017 at 9:40 PM, Dave Page  wrote:
> >>
> >> Thanks, patch applied!
> >>
> >> On Wed, Jun 21, 2017 at 12:44 PM, Khushboo Vashi
> >>  wrote:
> >> > Hi,
> >> >
> >> > Please find attached patch to fix RM #2487: get_preference() uses a
> >> > synchronous AJAX request.
> >> >
> >> > Introduced the client side caching for preferences to get rid of
> >> > synchronous
> >> > AJAX request.
> >> >
> >> >
> >> > Thanks,
> >> > Khushboo
> >>
> >>
> >>
> >> --
> >> 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
>
diff --git a/web/pgadmin/preferences/__init__.py b/web/pgadmin/preferences/__init__.py
index a59e26d..e3af7d0 100644
--- a/web/pgadmin/preferences/__init__.py
+++ b/web/pgadmin/preferences/__init__.py
@@ -154,7 +154,7 @@ def preferences_s():
 if len(m['categories']):
 for c in m['categories']:
 for p in c['preferences']:
-p['module'] = m['label']
+p['module'] = m['name']
 res.append(p)
 
 return ajax_response(
diff --git a/web/pgadmin/utils/preferences.py b/web/pgadmin/utils/preferences.py
index 3148417..c7127c9 100644
--- a/web/pgadmin/utils/preferences.py
+++ b/web/pgadmin/utils/preferences.py
@@ -303,6 +303,7 @@ class Preferences(object):
 res = {
 'id': self.mid,
 'label': self.label or self.name,
+'name': self.name,
 'categories': []
 }
 for c in self.categories:


pgAdmin 4 commit: Moved the javascripts of the following browser node m

2017-06-22 Thread Ashesh Vashi
Moved the javascripts of the following browser node modules to the
'static' directory from 'templates' in the respective module directory:
- Server Group
- Server
- Database
- Schema
- Cast
- Event trigger
- Extension
- Foreign data wrapper
- Language
- Catalog Object
- Collation
- Domain Constraint
- Domain
- Foreign server
- FTS Configuration
- FTS Dictionary
- FTS Parser
- FTS Template
- Function
- Procedure
- Trigger Function
- Package
- Sequence
- Catalog
- Schema
- Synonym
- Table
- Type
- Materialized View
- View
- pgAgent Modules
  + Job (pga_job)
  + Schedule (pga_schedule)
  + Steps (pga_jobstep)

Added new dynanic modules for listing the supported server types, and
current user information.

NOTE: We've not yet moved the javascripts for the children of the table
module.

Branch
--
master

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

Modified Files
--
web/pgadmin/browser/__init__.py|   30 +-
web/pgadmin/browser/collection.py  |   30 +-
web/pgadmin/browser/server_groups/__init__.py  |   12 +-
.../browser/server_groups/servers/__init__.py  |   49 +-
.../server_groups/servers/databases/__init__.py|   23 +-
.../servers/databases/casts/__init__.py|   27 +-
.../servers/databases/casts/static/js/cast.js  |  309 ++
.../databases/casts/templates/cast/js/casts.js |  309 --
.../servers/databases/event_triggers/__init__.py   |   26 +-
.../event_triggers/static/js/event_trigger.js  |  176 
.../templates/event_triggers/js/event_trigger.js   |  176 
.../servers/databases/extensions/__init__.py   |   23 +-
.../databases/extensions/static/js/extension.js|  256 +
.../templates/extensions/js/extensions.js  |  256 -
.../databases/foreign_data_wrappers/__init__.py|   28 +-
.../static/js/foreign_data_wrapper.js  |  188 
.../js/foreign_data_wrappers.js|  188 
.../servers/databases/languages/__init__.py|   27 +-
.../databases/languages/static/js/language.js  |  269 ++
.../languages/templates/languages/js/languages.js  |  269 --
.../servers/databases/schemas/__init__.py  |   17 +-
.../catalog_objects/static/js/catalog_object.js|   59 ++
.../templates/catalog_object/js/catalog_object.js  |   59 --
.../schemas/collations/static/js/collation.js  |  259 +
.../collations/templates/collation/js/collation.js |  259 -
.../schemas/domains/domain_constraints/__init__.py |   29 +-
.../static/js/domain_constraint.js |  146 +++
.../domain_constraints/js/domain_constraints.js|  146 ---
.../databases/schemas/domains/static/js/domain.js  |  346 +++
.../domains/templates/domains/js/domains.js|  346 ---
.../foreign_tables/static/js/foreign-table.js  |  719 ++
.../templates/foreign_tables/js/foreign_tables.js  |  719 --
.../static/js/fts_configuration.js |  613 
.../fts_configuration/js/fts_configuration.js  |  613 
.../fts_dictionaries/static/js/fts_dictionary.js   |  218 +
.../templates/fts_dictionary/js/fts_dictionary.js  |  218 -
.../schemas/fts_parser/static/js/fts_parser.js |  235 +
.../templates/fts_parser/js/fts_parser.js  |  235 -
.../fts_templates/static/js/fts_template.js|  174 
.../templates/fts_template/js/fts_templates.js |  174 
.../schemas/functions/static/js/function.js|  479 ++
.../schemas/functions/static/js/procedure.js   |  188 
.../functions/static/js/trigger_function.js|  400 
.../functions/templates/function/js/functions.js   |  479 --
.../functions/templates/procedure/js/procedures.js |  188 
.../trigger_function/js/trigger_functions.js   |  400 
.../schemas/packages/static/js/package.js  |  183 
.../packages/templates/package/js/package.js   |  183 
.../schemas/sequences/static/js/sequence.js|  313 ++
.../sequences/templates/sequence/js/sequence.js|  313 --
.../servers/databases/schemas/static/js/catalog.js |   82 ++
.../servers/databases/schemas/static/js/schema.js  |  496 ++
.../schemas/synonyms/static/js/synonym.js  |  249 +
.../synonyms/templates/synonym/js/synonym.js   |  249 -
.../databases/schemas/tables/static/js/table.js|  968 +++
.../schemas/tables/templates/table/js/table.js |  968 ---
.../schemas/templates/catalog/js/catalog.js|   82 --
.../schemas/templates/schema/js/schema.js  |  496 --
.../databases/schemas/types/static/js/type.js  |  949 +++
.../schemas/types/templates/type/js/type.js|  949 ---
.../servers/databases/schemas/utils.py |   10 +-
.../databases/schemas/views/static/js/mview.js |  326 +++
...

Build failed in Jenkins: pgadmin4-master-python36 #188

2017-06-22 Thread pgAdmin 4 Jenkins
See 


Changes:

[Ashesh Vashi] Moved the javascripts of the following browser node modules to 
the

--
[...truncated 288.97 KB...]
Update materialized view under schema node ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_add.DatabaseAddTestCase)
Check Databases Node URL ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_delete.DatabaseDeleteTestCase)
Check Databases Node URL ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
Check Databases Node URL ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_put.DatabasesUpdateTestCase)
Check Databases Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.resource_groups.tests.test_resource_groups_add.ResourceGroupsAddTestCase)
Add resource groups ... ok
runTest 
(pgadmin.browser.server_groups.servers.resource_groups.tests.test_resource_groups_delete.ResourceGroupsDeleteTestCase)
Delete resource groups ... ok
runTest 
(pgadmin.browser.server_groups.servers.resource_groups.tests.test_resource_groups_put.ResourceGroupsPutTestCase)
Put resource groups ... ok
runTest 
(pgadmin.browser.server_groups.servers.resource_groups.tests.tests_resource_groups_get.ResourceGroupsGetTestCase)
Get resource groups ... ok
runTest 
(pgadmin.browser.server_groups.servers.roles.tests.test_role_add.LoginRoleAddTestCase)
Check Role Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.roles.tests.test_role_delete.LoginRoleDeleteTestCase)
Check Role Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.roles.tests.test_role_get.LoginRoleGetTestCase)
Check Role Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.roles.tests.test_role_put.LoginRolePutTestCase)
Check Role Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tablespaces.tests.test_tbspc_add.TableSpaceAddTestCase)
Check Tablespace Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tablespaces.tests.test_tbspc_delete.TableSpaceDeleteTestCase)
Check Tablespace Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tablespaces.tests.test_tbspc_get.TablespaceGetTestCase)
Check Tablespace Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tablespaces.tests.test_tbspc_put.TableSpaceUpdateTestCase)
Check Tablespace Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_check_recovery.TestCheckRecovery)
Test for check recovery ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_dependencies_sql.TestDependenciesSql)
Test dependencies SQL file ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_dependents_sql.TestDependentsSql)
Test dependencies SQL file ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_role_dependencies_sql.TestRoleDependenciesSql)
Test Role Dependencies SQL file ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_add.ServersAddTestCase)
Default Server Node url ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_delete.ServerDeleteTestCase)
Default Server Node url ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_get.ServersGetTestCase)
Default Server Node url ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_put.ServerUpdateTestCase)
Default Server Node url ... ok
runTest (pgadmin.browser.server_groups.tests.test_sg_get.SgNodeTestCase)
Check Server Group Node ... ok
runTest 
(pgadmin.utils.javascript.tests.test_javascript_bundler.JavascriptBundlerTestCase)
scenario name: JavascriptBundlerTestCase ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a template when called ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a version 9.1 template when it is present ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a version 9.2 template when request for a higher version ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render default version when version 9.0 was requested and only 9.1 and 9.2 are 
present ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Raise error when version is smaller than available templates ... ok
runTest 
(regression.python_test_utils.sql_template_test_base.SQLTemplateTestBase)
parent test class ... ok

--
Ran 163 tests in 24.102s

OK

==
Test Result Summary
==

PostgreSQL 9.2:

143 tests passed
0 tests failed
20 tests skipped:
EventTriggerAd

pgAdmin 4 commit: Ensure default values are honoured when adding/editin

2017-06-22 Thread Dave Page
Ensure default values are honoured when adding/editing columns. Fixes #1860

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=137bae1b0494a7c763d302f5f5e652e5201abdea
Author: Murtuza Zabuawala 

Modified Files
--
.../foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql | 2 +-
.../foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql | 6 +++---
.../foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql | 2 +-
.../foreign_tables/templates/foreign_tables/sql/9.5_plus/update.sql | 6 +++---
.../schemas/tables/templates/column/sql/9.2_plus/update.sql | 2 +-
.../schemas/tables/templates/column/sql/default/create.sql  | 2 +-
.../schemas/tables/templates/column/sql/default/update.sql  | 2 +-
7 files changed, 11 insertions(+), 11 deletions(-)



Re: [pgAdmin4][PATCH] To fix the issue in column module

2017-06-22 Thread Dave Page
Thanks, applied.

On Thu, Jun 22, 2017 at 8:14 AM, Murtuza Zabuawala
 wrote:
> Hi,
>
> PFA patch to fix the issue where in column node we were not displaying
> column's default value properly, for example if the default value is zero.
> RM#1860
>
> I have also fixed similar issue in foreign table module.
>
> Please review.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: 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



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

2017-06-22 Thread pgAdmin 4 Jenkins
See 





pgAdmin 4 commit: Fix preferences handling for utilities.

2017-06-22 Thread Dave Page
Fix preferences handling for utilities.

Branch
--
master

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

Modified Files
--
web/pgadmin/preferences/__init__.py | 2 +-
web/pgadmin/utils/preferences.py| 1 +
2 files changed, 2 insertions(+), 1 deletion(-)



Re: [pgAdmin4][Patch]: Fixed #2487: get_preference() uses a synchronous AJAX request

2017-06-22 Thread Dave Page
Thanks, patch applied.

On Thu, Jun 22, 2017 at 11:06 AM, Khushboo Vashi
 wrote:
> Hi,
>
> Please find the attached fix for the same.
>
> Thanks,
> Khushboo
>
> On Thu, Jun 22, 2017 at 2:18 PM, Dave Page  wrote:
>>
>> Hmm, yes - and it's not giving the normal error instructing the user
>> to set the path, but another one: "Failed to load preference
>> pg_bin_dir of module paths".
>>
>> Khushboo, can you investigate and fix ASAP please?
>>
>> On Thu, Jun 22, 2017 at 9:31 AM, Murtuza Zabuawala
>>  wrote:
>> > Hi Khusboo,
>> >
>> > Looks like given change have broken Backup, Restore, Import/Export &
>> > Maintenance, even if I have binary path set it is throwing an error.
>> >
>> > --
>> > Regards,
>> > Murtuza Zabuawala
>> > EnterpriseDB: http://www.enterprisedb.com
>> > The Enterprise PostgreSQL Company
>> >
>> > On Wed, Jun 21, 2017 at 9:40 PM, Dave Page  wrote:
>> >>
>> >> Thanks, patch applied!
>> >>
>> >> On Wed, Jun 21, 2017 at 12:44 PM, Khushboo Vashi
>> >>  wrote:
>> >> > Hi,
>> >> >
>> >> > Please find attached patch to fix RM #2487: get_preference() uses a
>> >> > synchronous AJAX request.
>> >> >
>> >> > Introduced the client side caching for preferences to get rid of
>> >> > synchronous
>> >> > AJAX request.
>> >> >
>> >> >
>> >> > Thanks,
>> >> > Khushboo
>> >>
>> >>
>> >>
>> >> --
>> >> 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
>
>



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

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



Build failed in Jenkins: pgadmin4-master-python36 #189

2017-06-22 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Ensure default values are honoured when adding/editing columns. 
Fixes

[Dave Page] Fix preferences handling for utilities.

--
[...truncated 288.82 KB...]
Update materialized view under schema node ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_add.DatabaseAddTestCase)
Check Databases Node URL ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_delete.DatabaseDeleteTestCase)
Check Databases Node URL ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
Check Databases Node URL ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_put.DatabasesUpdateTestCase)
Check Databases Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.resource_groups.tests.test_resource_groups_add.ResourceGroupsAddTestCase)
Add resource groups ... ok
runTest 
(pgadmin.browser.server_groups.servers.resource_groups.tests.test_resource_groups_delete.ResourceGroupsDeleteTestCase)
Delete resource groups ... ok
runTest 
(pgadmin.browser.server_groups.servers.resource_groups.tests.test_resource_groups_put.ResourceGroupsPutTestCase)
Put resource groups ... ok
runTest 
(pgadmin.browser.server_groups.servers.resource_groups.tests.tests_resource_groups_get.ResourceGroupsGetTestCase)
Get resource groups ... ok
runTest 
(pgadmin.browser.server_groups.servers.roles.tests.test_role_add.LoginRoleAddTestCase)
Check Role Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.roles.tests.test_role_delete.LoginRoleDeleteTestCase)
Check Role Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.roles.tests.test_role_get.LoginRoleGetTestCase)
Check Role Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.roles.tests.test_role_put.LoginRolePutTestCase)
Check Role Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tablespaces.tests.test_tbspc_add.TableSpaceAddTestCase)
Check Tablespace Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tablespaces.tests.test_tbspc_delete.TableSpaceDeleteTestCase)
Check Tablespace Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tablespaces.tests.test_tbspc_get.TablespaceGetTestCase)
Check Tablespace Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tablespaces.tests.test_tbspc_put.TableSpaceUpdateTestCase)
Check Tablespace Node ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_check_recovery.TestCheckRecovery)
Test for check recovery ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_dependencies_sql.TestDependenciesSql)
Test dependencies SQL file ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_dependents_sql.TestDependentsSql)
Test dependencies SQL file ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_role_dependencies_sql.TestRoleDependenciesSql)
Test Role Dependencies SQL file ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_add.ServersAddTestCase)
Default Server Node url ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_delete.ServerDeleteTestCase)
Default Server Node url ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_get.ServersGetTestCase)
Default Server Node url ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_put.ServerUpdateTestCase)
Default Server Node url ... ok
runTest (pgadmin.browser.server_groups.tests.test_sg_get.SgNodeTestCase)
Check Server Group Node ... ok
runTest 
(pgadmin.utils.javascript.tests.test_javascript_bundler.JavascriptBundlerTestCase)
scenario name: JavascriptBundlerTestCase ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a template when called ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a version 9.1 template when it is present ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a version 9.2 template when request for a higher version ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render default version when version 9.0 was requested and only 9.1 and 9.2 are 
present ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Raise error when version is smaller than available templates ... ok
runTest 
(regression.python_test_utils.sql_template_test_base.SQLTemplateTestBase)
parent test class ... ok

--
Ran 163 tests in 23.716s

OK

==
Test Result Summary
==

PostgreSQL 9.2:

143 tests passed
0 tests failed
   

Re: [pgAdmin4][Patch][RM_2191] : Add support for the hostaddr connection parameter

2017-06-22 Thread Dave Page
Hi

On Thu, Jun 22, 2017 at 11:05 AM, Atul Sharma
 wrote:
> Hi,
>
> Please find attached patch for RM #2191 : Add support for hostaddr
> connection parameter

Unfortunately there are a few issues with this patch:

- It needs rebasing (blame Ashesh :-p )

- It's missing the documentation update (and screenshot update)

- I'm not sure the validation for a valid IPv6 address in
check_for_valid_ipv6 is correct. For example:

/^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$/.test('::1');
false
/^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$/.test('fe80::187f:316f:4bb8:8a3d');
false

Both of those are valid addresses.

Note that I've only eye-balled the patch so far, as I was unable to
apply it without manual work.

Thanks!

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

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



[pgAdmin4][Patch] To fix the in Import/Export module

2017-06-22 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue in import/export module where,
1) Command was failing due to incorrect tab delimiter passed to the copy
command.
2) User was not allowed to pass default delimiter(ie - no delimiter, let
copy command handle it) for csv & text file format user was forced to
select delimiter.
RM#1934

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git 
a/web/pgadmin/tools/import_export/templates/import_export/js/import_export.js 
b/web/pgadmin/tools/import_export/templates/import_export/js/import_export.js
index a8eac3c..8eebac5 100644
--- 
a/web/pgadmin/tools/import_export/templates/import_export/js/import_export.js
+++ 
b/web/pgadmin/tools/import_export/templates/import_export/js/import_export.js
@@ -23,7 +23,7 @@ define([
   encoding: undefined,
   oid: undefined,
   header: undefined,
-  delimiter: ';',
+  delimiter: '',
   quote: '\"',
   escape: '\'',
   null_string: undefined,
@@ -490,8 +490,8 @@ define([
 this.view.model.on('change', function() {
 if (!_.isUndefined(this.get('filename')) && 
this.get('filename') !== '') {
   this.errorModel.clear();
-  if (!_.isUndefined(this.get('delimiter')) && 
this.get('delimiter') !== '' &&
-  (this.get('delimiter').length == 1 || 
this.get('delimiter') == '[tab]')) {
+  if (!_.isUndefined(this.get('delimiter')) && 
!_.isNull(this.get('delimiter'))
+  ) {
 this.errorModel.clear();
 if (!_.isUndefined(this.get('quote')) && 
this.get('quote') !== '' &&
 this.get('quote').length == 1) {
diff --git 
a/web/pgadmin/tools/import_export/templates/import_export/sql/cmd.sql 
b/web/pgadmin/tools/import_export/templates/import_export/sql/cmd.sql
index 16de8c5..4936d65 100644
--- a/web/pgadmin/tools/import_export/templates/import_export/sql/cmd.sql
+++ b/web/pgadmin/tools/import_export/templates/import_export/sql/cmd.sql
@@ -1 +1 @@
-\copy {{ conn|qtIdent(data.schema, data.table) }} {% if columns %} {{ columns 
}} {% endif %} {% if data.is_import %}FROM{% else %}TO{% endif %} {{ 
data.filename|qtLiteral }} {% if data.oid %} OIDS {% endif %}{% if 
data.delimiter and data.format != 'binary' and data.delimiter == '[tab]' %} 
DELIMITER E'\\t' {% elif data.format != 'binary' and data.delimiter %} 
DELIMITER {{ data.delimiter|qtLiteral }}{% endif %}{% if data.format == 'csv' 
%} CSV {% endif %} {% if data.header %} HEADER {% endif %}{% if data.encoding 
%} ENCODING {{ data.encoding|qtLiteral }}{% endif %}{% if data.format == 'csv' 
and data.quote %} QUOTE {{ data.quote|qtLiteral }}{% endif %}{% if data.format 
!= 'binary' and data.null_string %} NULL {{ data.null_string|qtLiteral }}{% 
endif %}{% if data.format == 'csv' and data.escape %} ESCAPE {{ 
data.escape|qtLiteral }}{% endif %}{% if data.format == 'csv' and 
data.is_import and ignore_column_list %} FORCE_NOT_NULL {{ ignore_column_list 
}} {% endif %};
+\copy {{ conn|qtIdent(data.schema, data.table) }} {% if columns %} {{ columns 
}} {% endif %} {% if data.is_import %}FROM{% else %}TO{% endif %} {{ 
data.filename|qtLiteral }} {% if data.oid %} OIDS {% endif %}{% if 
data.delimiter is defined and data.delimiter == '' and (data.format == 'csv' or 
data.format == 'text') %} {% elif data.delimiter and data.format != 'binary' 
and data.delimiter == '[tab]' %} DELIMITER E'\t' {% elif data.format != 
'binary' and data.delimiter %} DELIMITER {{ data.delimiter|qtLiteral }}{% endif 
%}{% if data.format == 'csv' %} CSV {% endif %} {% if data.header %} HEADER {% 
endif %}{% if data.encoding %} ENCODING {{ data.encoding|qtLiteral }}{% endif 
%}{% if data.format == 'csv' and data.quote %} QUOTE {{ data.quote|qtLiteral 
}}{% endif %}{% if data.format != 'binary' and data.null_string %} NULL {{ 
data.null_string|qtLiteral }}{% endif %}{% if data.format == 'csv' and 
data.escape %} ESCAPE {{ data.escape|qtLiteral }}{% endif %}{% if data.format 
== 'csv' and data.is_import and ignore_column_list %} FORCE_NOT_NULL {{ 
ignore_column_list }} {% endif %};


pgAdmin 4 commit: Fix import/export to work as expected with TSV data.

2017-06-22 Thread Dave Page
Fix import/export to work as expected with TSV data. Fixes #1934

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=0ab637c7ab9dd7b23692dd2b6eda3b983fa7780f
Author: Murtuza Zabuawala 

Modified Files
--
.../tools/import_export/templates/import_export/js/import_export.js | 6 +++---
web/pgadmin/tools/import_export/templates/import_export/sql/cmd.sql | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)



Re: [pgAdmin4][Patch] To fix the in Import/Export module

2017-06-22 Thread Dave Page
Thanks, patch applied.

On Thu, Jun 22, 2017 at 1:26 PM, Murtuza Zabuawala
 wrote:
> Hi,
>
> PFA patch to fix the issue in import/export module where,
> 1) Command was failing due to incorrect tab delimiter passed to the copy
> command.
> 2) User was not allowed to pass default delimiter(ie - no delimiter, let
> copy command handle it) for csv & text file format user was forced to select
> delimiter.
> RM#1934
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: 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



Jenkins build is back to normal : pgadmin4-master-python36 #190

2017-06-22 Thread pgAdmin 4 Jenkins
See 





Re: [pgAdmin4][Patch]: Fixed #2487: get_preference() uses a synchronous AJAX request

2017-06-22 Thread Khushboo Vashi
Hi Dave,

One more fix for this module.

Thanks,
Khushboo

On Thu, Jun 22, 2017 at 4:49 PM, Dave Page  wrote:

> Thanks, patch applied.
>
> On Thu, Jun 22, 2017 at 11:06 AM, Khushboo Vashi
>  wrote:
> > Hi,
> >
> > Please find the attached fix for the same.
> >
> > Thanks,
> > Khushboo
> >
> > On Thu, Jun 22, 2017 at 2:18 PM, Dave Page  wrote:
> >>
> >> Hmm, yes - and it's not giving the normal error instructing the user
> >> to set the path, but another one: "Failed to load preference
> >> pg_bin_dir of module paths".
> >>
> >> Khushboo, can you investigate and fix ASAP please?
> >>
> >> On Thu, Jun 22, 2017 at 9:31 AM, Murtuza Zabuawala
> >>  wrote:
> >> > Hi Khusboo,
> >> >
> >> > Looks like given change have broken Backup, Restore, Import/Export &
> >> > Maintenance, even if I have binary path set it is throwing an error.
> >> >
> >> > --
> >> > Regards,
> >> > Murtuza Zabuawala
> >> > EnterpriseDB: http://www.enterprisedb.com
> >> > The Enterprise PostgreSQL Company
> >> >
> >> > On Wed, Jun 21, 2017 at 9:40 PM, Dave Page  wrote:
> >> >>
> >> >> Thanks, patch applied!
> >> >>
> >> >> On Wed, Jun 21, 2017 at 12:44 PM, Khushboo Vashi
> >> >>  wrote:
> >> >> > Hi,
> >> >> >
> >> >> > Please find attached patch to fix RM #2487: get_preference() uses a
> >> >> > synchronous AJAX request.
> >> >> >
> >> >> > Introduced the client side caching for preferences to get rid of
> >> >> > synchronous
> >> >> > AJAX request.
> >> >> >
> >> >> >
> >> >> > Thanks,
> >> >> > Khushboo
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> 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
> >
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/static/js/check_node_visibility.js b/web/pgadmin/static/js/check_node_visibility.js
index e50c2f5..ddd1990 100644
--- a/web/pgadmin/static/js/check_node_visibility.js
+++ b/web/pgadmin/static/js/check_node_visibility.js
@@ -30,7 +30,7 @@ define(['jquery', 'underscore', 'underscore.string'],
 return true;
   }
 
-  preference = pgBrowser.get_preference("Browser", 'show_node_'+node_type);
+  preference = pgBrowser.get_preference("browser", 'show_node_'+node_type);
 
   if (preference) {
 return preference.value


pgAdmin 4 commit: Additional preference fix.

2017-06-22 Thread Dave Page
Additional preference fix.

Branch
--
master

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

Modified Files
--
web/pgadmin/static/js/check_node_visibility.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Re: [pgAdmin4][Patch]: Fixed #2487: get_preference() uses a synchronous AJAX request

2017-06-22 Thread Dave Page
Thanks, applied.

On Thu, Jun 22, 2017 at 2:43 PM, Khushboo Vashi
 wrote:
> Hi Dave,
>
> One more fix for this module.
>
> Thanks,
> Khushboo
>
> On Thu, Jun 22, 2017 at 4:49 PM, Dave Page  wrote:
>>
>> Thanks, patch applied.
>>
>> On Thu, Jun 22, 2017 at 11:06 AM, Khushboo Vashi
>>  wrote:
>> > Hi,
>> >
>> > Please find the attached fix for the same.
>> >
>> > Thanks,
>> > Khushboo
>> >
>> > On Thu, Jun 22, 2017 at 2:18 PM, Dave Page  wrote:
>> >>
>> >> Hmm, yes - and it's not giving the normal error instructing the user
>> >> to set the path, but another one: "Failed to load preference
>> >> pg_bin_dir of module paths".
>> >>
>> >> Khushboo, can you investigate and fix ASAP please?
>> >>
>> >> On Thu, Jun 22, 2017 at 9:31 AM, Murtuza Zabuawala
>> >>  wrote:
>> >> > Hi Khusboo,
>> >> >
>> >> > Looks like given change have broken Backup, Restore, Import/Export &
>> >> > Maintenance, even if I have binary path set it is throwing an error.
>> >> >
>> >> > --
>> >> > Regards,
>> >> > Murtuza Zabuawala
>> >> > EnterpriseDB: http://www.enterprisedb.com
>> >> > The Enterprise PostgreSQL Company
>> >> >
>> >> > On Wed, Jun 21, 2017 at 9:40 PM, Dave Page  wrote:
>> >> >>
>> >> >> Thanks, patch applied!
>> >> >>
>> >> >> On Wed, Jun 21, 2017 at 12:44 PM, Khushboo Vashi
>> >> >>  wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > Please find attached patch to fix RM #2487: get_preference() uses
>> >> >> > a
>> >> >> > synchronous AJAX request.
>> >> >> >
>> >> >> > Introduced the client side caching for preferences to get rid of
>> >> >> > synchronous
>> >> >> > AJAX request.
>> >> >> >
>> >> >> >
>> >> >> > Thanks,
>> >> >> > Khushboo
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> 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
>> >
>> >
>>
>>
>>
>> --
>> 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



[pgAdmin4][Patch] To fix the issue in Column module

2017-06-22 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue in Column module where clearing the length of a
character(or any other type as well) generates empty SQL.
RM#2155

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/update.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/update.sql
index 2fef3b4..385e40e 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/update.sql
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/update.sql
@@ -9,7 +9,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 
 {% endif %}
 {###  Alter column type and collation ###}
-{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen and 
data.attlen != o_data.attlen) or (data.attprecision and data.attprecision != 
o_data.attprecision) %}
+{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen is 
defined and data.attlen != o_data.attlen) or (data.attprecision is defined and 
data.attprecision != o_data.attprecision) %}
 ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else 
%}{{conn|qtTypeIdent(o_data.name)}}{% endif %} TYPE {{ 
GET_TYPE.UPDATE_TYPE_SQL(conn, data, o_data) }}{% if data.collspcname and 
data.collspcname != o_data.collspcname %}
  COLLATE {{data.collspcname}}{% endif %};
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/default/update.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/default/update.sql
index fe2c73e..6b17481 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/default/update.sql
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/default/update.sql
@@ -9,7 +9,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 
 {% endif %}
 {###  Alter column type and collation ###}
-{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen and 
data.attlen != o_data.attlen) or (data.attprecision and data.attprecision != 
o_data.attprecision) %}
+{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen is 
defined and data.attlen != o_data.attlen) or (data.attprecision is defined and 
data.attprecision != o_data.attprecision) %}
 ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else 
%}{{conn|qtTypeIdent(o_data.name)}}{% endif %} TYPE {{ 
GET_TYPE.UPDATE_TYPE_SQL(conn, data, o_data) }}{% if data.collspcname and 
data.collspcname != o_data.collspcname %}
  COLLATE {{data.collspcname}}{% endif %};


Re: [pgadmin-hackers][patch] History Detail Pane

2017-06-22 Thread Surinder Kumar
Hi

Review comments:

​1. ​
Can we set "message"(in message detail) style property scroll to
​'​
auto
​'​
instead of
​'​
scroll
​'​
?

​2. ​
CSS property flex is supported for IE >= 9 as per reference

​. I tested this patch on IE and layout is broken.​

3. ​
Can the CSS styles in ‘history_detail_message.jsx’ moved out in a separate
stylesheet file
​ as inline styles in html are never recommended.​

​4. In 'codemirror.jsx', setInterval is used to bind
hydrateWhenBecomesVisible function after every 100ms. Can setTimeout ​be
used as it needs to bind only once ?
Also if setInterval is used, in componentWillUnmount clearInterval(...) should
be implemented.

5. The text like 'Rows Affected' or 'Duration' should be wrapped in
'gettext' for translation?


On Thu, Jun 22, 2017 at 11:39 PM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Hackers
>
> You can find attached a new version of this patch that corrects the issue
> Dave mentioned. We've added direct unit tests for the CodeMirror react
> wrapper to help prevent this bug from creeping in again. See
> ./web/regression/javascript/code_mirror_spec.jsx
>
> Thanks,
> Matt and João
>
> On Wed, Jun 21, 2017 at 12:22 PM, Dave Page  wrote:
>
>> Hi
>>
>> Looking good. The only issue I found so far occurs if you open the
>> query tool, then immediately click on the history tab:
>>
>> TypeError: Cannot read property 'CodeMirror' of undefined
>> at Object. (sqleditor.js:882)
>> at triggerEvents (backbone.js:208)
>> at Object.trigger (backbone.js:148)
>> at i.eventFunc (panel.js:101)
>> at i.__trigger (wcDocker.js:1941)
>> at i.__update (wcDocker.js:1818)
>> at i.__onTabChange (wcDocker.js:3970)
>> at i.__update (wcDocker.js:3482)
>> at i.__update (wcDocker.js:2787)
>> at wcDocker.js:20117
>>
>> On Wed, Jun 21, 2017 at 4:45 PM, George Gelashvili
>>  wrote:
>> > Hi
>> >
>> > We rebased this on top of latest master.
>> >
>> > Cheers,
>> > Matt and George
>> >
>> > On Thu, Jun 15, 2017 at 10:43 AM, Dave Page  wrote:
>> >>
>> >> Hi
>> >>
>> >> We use Qt 5.8 at the moment, with the updated QtWebKit TP5 release
>> >> from https://github.com/annulen/webkit/releases. The issue occurs on
>> >> Windows and Mac, and probably Linux as well.
>> >>
>> >> Test builds can be found here: https://developer.pgadmin.org/
>> ~dpage/debug/
>> >>
>> >> On Thu, Jun 15, 2017 at 2:33 PM, Sarah McAlear 
>> >> wrote:
>> >> > Hi Dave!
>> >> >
>> >> > Just to verify, which version of QT are you using? The Readme calls
>> for
>> >> > 5.5
>> >> > at the newest. Could you send us the compiled version of the app? Are
>> >> > you
>> >> > only seeing this on Windows?
>> >> >
>> >> > Thanks,
>> >> > Sarah & Shruti & João
>> >> >
>> >> > On Wed, Jun 14, 2017 at 3:46 PM, Sarah McAlear 
>> >> > wrote:
>> >> >>
>> >> >> Sounds good! We're looking into it.
>> >> >>
>> >> >> On Wed, Jun 14, 2017 at 12:15 PM, Robert Eckhardt
>> >> >> 
>> >> >> wrote:
>> >> >>>
>> >> >>> Absolutely makes sense.
>> >> >>>
>> >> >>> Matt, Sarah,
>> >> >>>
>> >> >>> Do we understand the issues Dave is mentioning well enough to look
>> >> >>> into
>> >> >>> it and tackle it?
>> >> >>>
>> >> >>> -- Rob
>> >> >>>
>> >> >>> On Wed, Jun 14, 2017 at 8:12 AM, Dave Page 
>> wrote:
>> >> 
>> >>  Hi,
>> >> 
>> >>  Before I commit anything else for this patch, we need to fix the
>> >>  existing changes so they work in the desktop runtime (see the
>> >>  previous
>> >>  thread with the patches for the history pane changes). Have any of
>> >>  your team been able to look at that yet?
>> >> 
>> >>  On Wed, Jun 14, 2017 at 4:07 PM, Sarah McAlear <
>> smcal...@pivotal.io>
>> >>  wrote:
>> >>  > Hi Hackers!
>> >>  >
>> >>  > This patch includes a new pane in the history tab that displays
>> the
>> >>  > full
>> >>  > formatted query and meta data about the query.
>> >>  >
>> >>  > Thanks!
>> >>  > Shruti & Sarah
>> >>  >
>> >>  >
>> >>  >
>> >>  >
>> >>  >
>> >>  >
>> >>  > --
>> >>  > Sent via pgadmin-hackers mailing list
>> >>  > (pgadmin-hack...@postgresql.org)
>> >>  > To make changes to your subscription:
>> >>  > http://www.postgresql.org/mailpref/pgadmin-hackers
>> >>  >
>> >> 
>> >> 
>> >> 
>> >>  --
>> >>  Dave Page
>> >>  Blog: http://pgsnake.blogspot.com
>> >>  Twitter: @pgsnake
>> >> 
>> >>  EnterpriseDB UK: http://www.enterprisedb.com
>> >>  The Enterprise PostgreSQL Company
>> >> 
>> >> 
>> >>  --
>> >>  Sent via pgadmin-hackers mailing list
>> >>  (pgadmin-hack...@postgresql.org)
>> >>  To make changes to your subscription:
>> >>  http://www.postgresql.org/mailpref/pgadmin-hackers
>> >> >>>
>> >> >>>
>> >> >>
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Dave Page
>> >> Blog: http://pgsnake.

[pgAdmin4][Patch] To fix the issue in Debugger module

2017-06-22 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue in Debugger module where it was unable to start
debugging if 'plugin_debugger' can not found in shared_preload_libraries.
RM#2162

Original patch by: Kit Yam Tse 
(who reported the issue)

I just re-based it against current code.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/tools/debugger/__init__.py 
b/web/pgadmin/tools/debugger/__init__.py
index 79e5eae..22df207 100644
--- a/web/pgadmin/tools/debugger/__init__.py
+++ b/web/pgadmin/tools/debugger/__init__.py
@@ -207,17 +207,6 @@ def init_function(node_type, sid, did, scid, fid, 
trid=None):
 " and cannot be debugged."
 )
 else:
-# If user is super user then we should check debugger library is 
loaded or not
-if user['is_superuser']:
-status_in, rid_pre = conn.execute_scalar("SHOW 
shared_preload_libraries")
-if not status_in:
-return internal_server_error(gettext("Could not fetch 
debugger plugin information."))
-
-# Need to check if plugin is really loaded or not with 
"plugin_debugger" string
-if "plugin_debugger" not in rid_pre:
-ret_status = False
-msg = gettext("The debugger plugin is not enabled. Please 
add the plugin to the shared_preload_libraries setting in the postgresql.conf 
file and restart the database server.")
-
 status_in, rid_tar = conn.execute_scalar(
 "SELECT count(*) FROM pg_proc WHERE proname = 
'pldbg_get_target_info'")
 if not status_in:


Re: [pgadmin-hackers][patch] History Detail Pane

2017-06-22 Thread Murtuza Zabuawala
On Fri, Jun 23, 2017 at 11:24 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> Review comments:
>
> ​1. ​
> Can we set "message"(in message detail) style property scroll to
> ​'​
> auto
> ​'​
> instead of
> ​'​
> scroll
> ​'​
> ?
>
> ​2. ​
> CSS property flex is supported for IE >= 9 as per reference
> 
> ​. I tested this patch on IE and layout is broken.​
>
Anyways IE-9/10 are outdated and no longer supported by Microsoft, the only
supported browsers are IE-11+.

>
> 3. ​
> Can the CSS styles in ‘history_detail_message.jsx’ moved out in a separate
> stylesheet file
> ​ as inline styles in html are never recommended.​
>
> ​4. In 'codemirror.jsx', setInterval is used to bind
> hydrateWhenBecomesVisible function after every 100ms. Can setTimeout ​be
> used as it needs to bind only once ?
> Also if setInterval is used, in componentWillUnmount clearInterval(...) should
> be implemented.
>
> 5. The text like 'Rows Affected' or 'Duration' should be wrapped in
> 'gettext' for translation?
>
>
> On Thu, Jun 22, 2017 at 11:39 PM, Joao Pedro De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Hackers
>>
>> You can find attached a new version of this patch that corrects the issue
>> Dave mentioned. We've added direct unit tests for the CodeMirror react
>> wrapper to help prevent this bug from creeping in again. See
>> ./web/regression/javascript/code_mirror_spec.jsx
>>
>> Thanks,
>> Matt and João
>>
>> On Wed, Jun 21, 2017 at 12:22 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> Looking good. The only issue I found so far occurs if you open the
>>> query tool, then immediately click on the history tab:
>>>
>>> TypeError: Cannot read property 'CodeMirror' of undefined
>>> at Object. (sqleditor.js:882)
>>> at triggerEvents (backbone.js:208)
>>> at Object.trigger (backbone.js:148)
>>> at i.eventFunc (panel.js:101)
>>> at i.__trigger (wcDocker.js:1941)
>>> at i.__update (wcDocker.js:1818)
>>> at i.__onTabChange (wcDocker.js:3970)
>>> at i.__update (wcDocker.js:3482)
>>> at i.__update (wcDocker.js:2787)
>>> at wcDocker.js:20117
>>>
>>> On Wed, Jun 21, 2017 at 4:45 PM, George Gelashvili
>>>  wrote:
>>> > Hi
>>> >
>>> > We rebased this on top of latest master.
>>> >
>>> > Cheers,
>>> > Matt and George
>>> >
>>> > On Thu, Jun 15, 2017 at 10:43 AM, Dave Page  wrote:
>>> >>
>>> >> Hi
>>> >>
>>> >> We use Qt 5.8 at the moment, with the updated QtWebKit TP5 release
>>> >> from https://github.com/annulen/webkit/releases. The issue occurs on
>>> >> Windows and Mac, and probably Linux as well.
>>> >>
>>> >> Test builds can be found here: https://developer.pgadmin.org/
>>> ~dpage/debug/
>>> >>
>>> >> On Thu, Jun 15, 2017 at 2:33 PM, Sarah McAlear 
>>> >> wrote:
>>> >> > Hi Dave!
>>> >> >
>>> >> > Just to verify, which version of QT are you using? The Readme calls
>>> for
>>> >> > 5.5
>>> >> > at the newest. Could you send us the compiled version of the app?
>>> Are
>>> >> > you
>>> >> > only seeing this on Windows?
>>> >> >
>>> >> > Thanks,
>>> >> > Sarah & Shruti & João
>>> >> >
>>> >> > On Wed, Jun 14, 2017 at 3:46 PM, Sarah McAlear >> >
>>> >> > wrote:
>>> >> >>
>>> >> >> Sounds good! We're looking into it.
>>> >> >>
>>> >> >> On Wed, Jun 14, 2017 at 12:15 PM, Robert Eckhardt
>>> >> >> 
>>> >> >> wrote:
>>> >> >>>
>>> >> >>> Absolutely makes sense.
>>> >> >>>
>>> >> >>> Matt, Sarah,
>>> >> >>>
>>> >> >>> Do we understand the issues Dave is mentioning well enough to look
>>> >> >>> into
>>> >> >>> it and tackle it?
>>> >> >>>
>>> >> >>> -- Rob
>>> >> >>>
>>> >> >>> On Wed, Jun 14, 2017 at 8:12 AM, Dave Page 
>>> wrote:
>>> >> 
>>> >>  Hi,
>>> >> 
>>> >>  Before I commit anything else for this patch, we need to fix the
>>> >>  existing changes so they work in the desktop runtime (see the
>>> >>  previous
>>> >>  thread with the patches for the history pane changes). Have any
>>> of
>>> >>  your team been able to look at that yet?
>>> >> 
>>> >>  On Wed, Jun 14, 2017 at 4:07 PM, Sarah McAlear <
>>> smcal...@pivotal.io>
>>> >>  wrote:
>>> >>  > Hi Hackers!
>>> >>  >
>>> >>  > This patch includes a new pane in the history tab that
>>> displays the
>>> >>  > full
>>> >>  > formatted query and meta data about the query.
>>> >>  >
>>> >>  > Thanks!
>>> >>  > Shruti & Sarah
>>> >>  >
>>> >>  >
>>> >>  >
>>> >>  >
>>> >>  >
>>> >>  >
>>> >>  > --
>>> >>  > Sent via pgadmin-hackers mailing list
>>> >>  > (pgadmin-hack...@postgresql.org)
>>> >>  > To make changes to your subscription:
>>> >>  > http://www.postgresql.org/mailpref/pgadmin-hackers
>>> >>  >
>>> >> 
>>> >> 
>>> >> 
>>> >>  --
>>> >>  Dave Page
>>> >>  Blog: http://pgsnake.blogspot.com
>>> >>  Twitter: @pgsnake
>>> >> 
>>> >>  EnterpriseDB UK: http://www.en