Re: [pgAdmin4][Pattch] - RM #3673 - "Download as .csv" F8 does NOT work when one of joined files is a TEMPORARY file

2019-02-18 Thread Khushboo Vashi
On Thu, Feb 14, 2019 at 4:12 PM Dave Page  wrote:

> Hi
>
> On Thu, Feb 14, 2019 at 6:56 AM Khushboo Vashi
>  wrote:
> >
> > Hi,
> >
> > Please find the attached patch to fix the RM #3673 - "Download as .csv"
> F8 does NOT work when one of joined files is a TEMPORARY file
> >
> > To fix this issue, used the existing query tool connection instead of a
> new connection to download the CSV file.
>
> That side of it seems to work well, however, I can still attempt to
> execute queries in the tool whilst it's running. We need to display
> the same gray screen with the spinner whilst a CSV download is
> executing as we do when a normal query is executing. We also need to
> ensure the button bar behaves appropriately - e.g. the execute options
> should be disabled, the cancel button should be enabled etc.
>
> We use an iframe to download the CSV file. So, after attaching the proper
URL to the iframe, the browser handles the download part.
So, the main problem is catching the event after the download completes.

Any suggestion?

>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgAdmin4][Pattch] - RM #3673 - "Download as .csv" F8 does NOT work when one of joined files is a TEMPORARY file

2019-02-18 Thread Dave Page
On Mon, Feb 18, 2019 at 9:08 AM Khushboo Vashi
 wrote:
>
>
>
> On Thu, Feb 14, 2019 at 4:12 PM Dave Page  wrote:
>>
>> Hi
>>
>> On Thu, Feb 14, 2019 at 6:56 AM Khushboo Vashi
>>  wrote:
>> >
>> > Hi,
>> >
>> > Please find the attached patch to fix the RM #3673 - "Download as .csv" F8 
>> > does NOT work when one of joined files is a TEMPORARY file
>> >
>> > To fix this issue, used the existing query tool connection instead of a 
>> > new connection to download the CSV file.
>>
>> That side of it seems to work well, however, I can still attempt to
>> execute queries in the tool whilst it's running. We need to display
>> the same gray screen with the spinner whilst a CSV download is
>> executing as we do when a normal query is executing. We also need to
>> ensure the button bar behaves appropriately - e.g. the execute options
>> should be disabled, the cancel button should be enabled etc.
>>
> We use an iframe to download the CSV file. So, after attaching the proper URL 
> to the iframe, the browser handles the download part.
> So, the main problem is catching the event after the download completes.
>
> Any suggestion?

We only used the iframe because we wanted to make it run
asynchronously didn't we? As that's no longer a concern


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

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



Re: [pgAdmin4][Pattch] - RM #3673 - "Download as .csv" F8 does NOT work when one of joined files is a TEMPORARY file

2019-02-18 Thread Khushboo Vashi
On Mon, Feb 18, 2019 at 3:08 PM Dave Page  wrote:

> On Mon, Feb 18, 2019 at 9:08 AM Khushboo Vashi
>  wrote:
> >
> >
> >
> > On Thu, Feb 14, 2019 at 4:12 PM Dave Page  wrote:
> >>
> >> Hi
> >>
> >> On Thu, Feb 14, 2019 at 6:56 AM Khushboo Vashi
> >>  wrote:
> >> >
> >> > Hi,
> >> >
> >> > Please find the attached patch to fix the RM #3673 - "Download as
> .csv" F8 does NOT work when one of joined files is a TEMPORARY file
> >> >
> >> > To fix this issue, used the existing query tool connection instead of
> a new connection to download the CSV file.
> >>
> >> That side of it seems to work well, however, I can still attempt to
> >> execute queries in the tool whilst it's running. We need to display
> >> the same gray screen with the spinner whilst a CSV download is
> >> executing as we do when a normal query is executing. We also need to
> >> ensure the button bar behaves appropriately - e.g. the execute options
> >> should be disabled, the cancel button should be enabled etc.
> >>
> > We use an iframe to download the CSV file. So, after attaching the
> proper URL to the iframe, the browser handles the download part.
> > So, the main problem is catching the event after the download completes.
> >
> > Any suggestion?
>
> We only used the iframe because we wanted to make it run
> asynchronously didn't we?

Yes, that's right. By using iframe the query tool page remains as it is and
side by side we download the file.
So, now I can think of only one solution, to set a cookie just to verify
that the report has been sent to the browser and the connection is now free
now.

> As that's no longer a concern



>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgAdmin4][Pattch] - RM #3673 - "Download as .csv" F8 does NOT work when one of joined files is a TEMPORARY file

2019-02-18 Thread Dave Page
On Mon, Feb 18, 2019 at 10:51 AM Khushboo Vashi
 wrote:
>
>
>
> On Mon, Feb 18, 2019 at 3:08 PM Dave Page  wrote:
>>
>> On Mon, Feb 18, 2019 at 9:08 AM Khushboo Vashi
>>  wrote:
>> >
>> >
>> >
>> > On Thu, Feb 14, 2019 at 4:12 PM Dave Page  wrote:
>> >>
>> >> Hi
>> >>
>> >> On Thu, Feb 14, 2019 at 6:56 AM Khushboo Vashi
>> >>  wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > Please find the attached patch to fix the RM #3673 - "Download as .csv" 
>> >> > F8 does NOT work when one of joined files is a TEMPORARY file
>> >> >
>> >> > To fix this issue, used the existing query tool connection instead of a 
>> >> > new connection to download the CSV file.
>> >>
>> >> That side of it seems to work well, however, I can still attempt to
>> >> execute queries in the tool whilst it's running. We need to display
>> >> the same gray screen with the spinner whilst a CSV download is
>> >> executing as we do when a normal query is executing. We also need to
>> >> ensure the button bar behaves appropriately - e.g. the execute options
>> >> should be disabled, the cancel button should be enabled etc.
>> >>
>> > We use an iframe to download the CSV file. So, after attaching the proper 
>> > URL to the iframe, the browser handles the download part.
>> > So, the main problem is catching the event after the download completes.
>> >
>> > Any suggestion?
>>
>> We only used the iframe because we wanted to make it run
>> asynchronously didn't we?
>
> Yes, that's right. By using iframe the query tool page remains as it is and 
> side by side we download the file.
> So, now I can think of only one solution, to set a cookie just to verify that 
> the report has been sent to the browser and the connection is now free now.

Are there no examples of people doing something similar on the
internet? Seems like it might be a common problem.

Or does it even matter once the download has begun?

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

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



pgAdmin 4 commit: Fix treeview state saving after reset.

2019-02-18 Thread Dave Page
Fix treeview state saving after reset.

Branch
--
master

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

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



pgAdmin 4 commit: Set the background colour for backform notes, and add

2019-02-18 Thread Dave Page
Set the background colour for backform notes, and add an icon. Fixes #3948

Branch
--
master

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

Modified Files
--
web/pgadmin/static/js/backform.pgadmin.js| 19 ++-
web/pgadmin/static/scss/_backform.overrides.scss | 17 ++---
web/pgadmin/tools/backup/static/js/backup.js |  4 ++--
3 files changed, 22 insertions(+), 18 deletions(-)



Build failed in Jenkins: pgadmin4-master-python37 #174

2019-02-18 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Set the background colour for backform notes, and add an icon. Fixes

--
[...truncated 960.13 KB...]
When backup the server,
When backup the server with option 
only_data,
When backup the server with option 
only_schema,
When backup the server with option - Do 
not save privilege, tablespace, unlogged table data,
When backup the server with option - Do 
not save comments,,
When backup the server with option - 
all queries,
When backup the server with option - 
miscellaneous,
When backup the server with encoding,
When backup globals)
TestUtilityCheckRouteCase (Check utility path route for backup 
utility,
Check utility path route for import 
export utility,
Check utility path route for 
maintenance utility,
Check utility path route for restore 
utility)
BackupJobTest (When backup the object with the default options)
MaintenanceJobTest (When maintenance the object with the 
default options)
MaintenanceCreateJobTest (When maintenance object with default 
options,
When maintenance object with VACUUM 
FULL,
When maintenance object with the 
ANALYZE,
When maintenance the object with the 
REINDEX,
When maintenance the object with the 
CLUSTER)
RestoreJobTest (When restore the object with the default 
options)
RestoreCreateJobTest (When restore object with default options,
When restore object with format 
directory,
When restore object with the sections 
options,
When restore the object with Type of 
objects,
When restore object with option - Do 
not save,
When restore object with option - Do 
not save comments,
When restore object with option - 
Queries,
When restore object with option - 
Disbale,
When restore object with option - 
Miscellaneous)
NOTE: Configuring authentication for DESKTOP mode.
pgAdmin 4 - Application Initialisation
==

Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Executing and polling with: 2 NOTICES WITH DATASET
Executing and polling with: 1000 NOTICES WITH DATASET
Executing and polling with: NO NOTICE WITH DATASET
Please check output in file: 



EDB Postgres AS 9.5:

433 tests passed
0 tests failed
21 tests skipped:
TableAddTestCase (Create Range p

pgAdmin 4 commit: Fix paste issue during commit :-s

2019-02-18 Thread Dave Page
Fix paste issue during commit :-s

Branch
--
master

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

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



Build failed in Jenkins: pgadmin4-master-python27 #943

2019-02-18 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Set the background colour for backform notes, and add an icon. Fixes

--
[...truncated 962.31 KB...]
Update schedule add exception,
Update schedule with start and end time)
BackupJobTest (When backup the object with the default options)
TestSSLConnection (Test for SSL connection)
PgAgentGetTestCase (Get pgAgent job)
PgAgentPutStepTestCase (Update step with kind, description, 
code and error,
Update step with connection type and 
string)
PgAgentDeleteTestCase (Delete pgAgent job)
RestoreJobTest (When restore the object with the default 
options)
PgAgentDeleteScheduleTestCase (Delete pgAgent Schedule)

EDB Postgres AS 9.2:

419 tests passed
0 tests failed
35 tests skipped:
PgAgentAddStepTestCase (Create step for pgAgent job)
PgAgentAddScheduleTestCase (Create schedule with exception in 
pgAgent job)
TableUpdateTestCase (Detach partition from existing list 
partitioned table,
Create partitions of existing range 
partitioned table,
Detach partition from existing range 
partitioned table,
Attach partition to existing range 
partitioned table,
Attach partition to existing list 
partitioned table,
Create partitions of existing list 
partitioned table)
ViewsDeleteTestCase (Delete materialized view under schema node)
ViewsGetTestCase (Get materialized view under schema node)
PgAgentPutTestCase (Put pgAgent job)
ResourceGroupsGetTestCase (Get resource groups)
TableAddTestCase (Create Hash partitioned table with 2 
partitions,
Create Range partitioned table with 2 
partitions,
Create List partitioned table with 2 
partitions)
ViewsDeleteMultipleTestCase (Delete multiple materialized view 
under schema node)
PgAgentDeleteScheduleTestCase (Delete pgAgent Schedule)
ResourceGroupsDeleteTestCase (Delete multiple resource groups,
Delete resource groups)
PgAgentPutScheduleTestCase (Update schedule with repeat,
Update schedule change exception date 
and time,
Update schedule delete exception,
Update schedule add exception,
Update schedule with start and end time)
ViewsAddTestCase (Add materialized view under schema node)
EventTriggerDeleteTestCase (Fetch Event Trigger Node URL)
MaintenanceJobTest (When maintenance the object with the 
default options)
MaintenanceCreateJobTest (When maintenance the object with the 
CLUSTER,
When maintenance object with VACUUM 
FULL,
When maintenance object with the 
ANALYZE,
When maintenance the object with the 
REINDEX,
When maintenance object with default 
options)
EventTriggerMultipleDeleteTestCase (Fetch Event Trigger Node 
URL)
TestUtilityCheckRouteCase (Check utility path route for backup 
utility,
Check utility path route for 
maintenance utility,
Check utility path route for import 
export utility,
Check utility path route for restore 
utility)
PgAgentStatsTestCase (Check the stats of pgAgent job)
PgAgentAddTestCase (Add pgAgent job)
BackupCreateJobTest (When backup the server with option - all 
queries,
When backup the object with format tar,
When backup object with default options,
When backup the object with option - Do 
not save comments,,
When backup globals,
When backup the server with option 
only_schema,
When backup the object with option 
only_data,
When backup the object with option 
sections to all data,
   

Jenkins build is back to normal : pgadmin4-master-python37 #175

2019-02-18 Thread pgAdmin 4 Jenkins
See 





Jenkins build is back to normal : pgadmin4-master-python27 #944

2019-02-18 Thread pgAdmin 4 Jenkins
See 





[Patch]: Minor change in dependency_inventory file to generate library file

2019-02-18 Thread Neel Patel
Hi,

Please find attached patch to handle JSON object properly to avoid error
like "the JSON object must be str, not 'bytes'" while generating
library.txt file.

Verified with both python2 and python3. Do review it and let me know for
comments.

Thanks,
Neel Patel

-- 
 
 


dependency_inventory_decode.patch
Description: Binary data


Re: [pgAdmin4][Pattch] - RM #3673 - "Download as .csv" F8 does NOT work when one of joined files is a TEMPORARY file

2019-02-18 Thread Khushboo Vashi
Hi Dave,

On Mon, Feb 18, 2019 at 4:49 PM Dave Page  wrote:

> On Mon, Feb 18, 2019 at 10:51 AM Khushboo Vashi
>  wrote:
> >
> >
> >
> > On Mon, Feb 18, 2019 at 3:08 PM Dave Page  wrote:
> >>
> >> On Mon, Feb 18, 2019 at 9:08 AM Khushboo Vashi
> >>  wrote:
> >> >
> >> >
> >> >
> >> > On Thu, Feb 14, 2019 at 4:12 PM Dave Page  wrote:
> >> >>
> >> >> Hi
> >> >>
> >> >> On Thu, Feb 14, 2019 at 6:56 AM Khushboo Vashi
> >> >>  wrote:
> >> >> >
> >> >> > Hi,
> >> >> >
> >> >> > Please find the attached patch to fix the RM #3673 - "Download as
> .csv" F8 does NOT work when one of joined files is a TEMPORARY file
> >> >> >
> >> >> > To fix this issue, used the existing query tool connection instead
> of a new connection to download the CSV file.
> >> >>
> >> >> That side of it seems to work well, however, I can still attempt to
> >> >> execute queries in the tool whilst it's running. We need to display
> >> >> the same gray screen with the spinner whilst a CSV download is
> >> >> executing as we do when a normal query is executing. We also need to
> >> >> ensure the button bar behaves appropriately - e.g. the execute
> options
> >> >> should be disabled, the cancel button should be enabled etc.
> >> >>
> >> > We use an iframe to download the CSV file. So, after attaching the
> proper URL to the iframe, the browser handles the download part.
> >> > So, the main problem is catching the event after the download
> completes.
> >> >
> >> > Any suggestion?
> >>
> >> We only used the iframe because we wanted to make it run
> >> asynchronously didn't we?
> >
> > Yes, that's right. By using iframe the query tool page remains as it is
> and side by side we download the file.
> > So, now I can think of only one solution, to set a cookie just to verify
> that the report has been sent to the browser and the connection is now free
> now.
>
> Are there no examples of people doing something similar on the
> internet? Seems like it might be a common problem.
>
>
I have found 2 ways which are widely used to download the file:

1. *Iframe*
  - With this option, we can download the file without disturbing the
current page which we have implemented, but the drawback is that the
download part will be handled by the browser itself, so we can not catch
the event where we can disable the query tool buttons and put the loader.
2. *Anchor tag with Download attribute with AJAX*
  - With this option, we can achieve what we required now. I have attached
the patch for the same. One drawback, it is not supported on *Safari 10*
which is our supported platform. It is supported on *Safari 10.1 and *above

Or does it even matter once the download has begun?
>
> Thanks,
Khushboo

> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

-- 
 
 


RM_3673_v1.patch
Description: Binary data


[pgAdmin4][Patch]: RM #3958 Query Tool commits after SELECT statements regardless of 'Auto commit' setting

2019-02-18 Thread Akshay Joshi
Hi Hackers,

Attached is the patch to fix RM "#3958 Query Tool commits after SELECT
statements regardless of 'Auto commit' setting."

Please review it.

-- 
*Akshay Joshi*

*Sr. Software Architect *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*

-- 
 
 


RM_3958.patch
Description: Binary data