Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-27 Thread Robert Eckhardt
On Tue, Mar 27, 2018 at 9:54 AM, Murtuza Zabuawala  wrote:

>
>
> On Tue, Mar 27, 2018 at 7:06 PM, Robert Eckhardt 
> wrote:
>
>>
>>
>> On Tue, Mar 27, 2018 at 6:25 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> On Tue, Mar 27, 2018 at 3:13 PM, Dave Page  wrote:
>>>


 On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt 
 wrote:

>
>
> On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Hackers,
>>
>> @Murtuza: The patch codewise looks good. Nice to see that we are
>> using axios instead of jquery ajax calls and that there is some coverage
>> for the change.
>> Nevertheless the Javascript testing looks a bit slim and could be
>> improved. Also the DataSorting class could have some other member 
>> functions
>> like the model validation could be extracted out so that it is easily
>> tested.
>>
>>
>> @Hackers: This was how we tried to test this feature:
>> 1 - Started pgAdmin
>> 2 - Opened the query tool for a specific server
>> 3 - Executed a SQL statment
>> 4 - Pressed the column header to try to order, nothing happened
>> 5 - Right clicked the column header to see if it was there the
>> option, nothing
>>
>> This is the behavior that we were expecting, not to have to open Data
>> View and then press the icon that is not even near the grid in order to
>> sort the column. Is this really the way we want people to use the grid in
>> pgAdmin? Should it be more intuitive?
>>
>
> Have we considered making the grid behave more like excel or other
> grids? I think that having the ascending and descending inside the column
> header, we could similarly provide filtering. Something that would give
> users a more intuitive place to look.
>

 Doing the sorting via header clicks is convenient but very restrictive.
 How do you specify multiple columns to sort by for example? The current
 design allows you to select columns and the sort order as you see fit.

>>>
>> Honestly I'm not sold on my idea, I was just proposing an alternative in
>> an effort to start a discussion about the user experience. Ideally what I'd
>> like to see, maybe this happened, is some user research. When we initial
>> worked on refactoring the results grid we made a bunch of changes. One of
>> the things we intended to do was to follow up to see how people were using
>> the grid now so that we could better understand how it was now being used
>> in order to design and implement features just like this. Clearly we
>> haven't gotten there yet.
>>
>>
>>>
>>> Another reason we can't use that because w
>>> e have already occupied that behaviour for selecting entire column
>>> ​ when user clicks on header.
>>> As Dave suggested, I will be merging it with filter dialog meaning it
>>> will be accessible via direct button on toolbar & keyboard shortcut.​
>>> ​
>>>
>>
>> How are users currently interacting with that filter dialog?
>>
>
> ​By clicking on the toolbar button as well as keyboard shortcut.
> ​
>
>
>
>

Sorry I wasn't clear. My question was more along the lines of, do we know
if people are using the filter functionality?  What kind of filters are
people using?  What do they like about it? What do they wish they could do
above and beyond sorting, etc.

-- Rob


>
>> What I'm suggesting is that we understand how users want to interact with
>> their results, be those the results of a query or a table view, then we can
>> design something that meets those needs. I agree that changing the column
>> selection behavior isn't desirable, however, I also feel like providing the
>> best user experience is better than holding onto a particular feature
>> implementation.
>> ​
>>
>>
>
>> -- Rob
>>
>>
>>>
>>>
 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

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

>>>
>>>
>>
>


Re: pgadmin healthcheck-url

2018-03-27 Thread Murtuza Zabuawala
I'm not able to re-produce the behaviour when using browser.

- Could you let us know the exact steps to re-produce the issue?
- How did you trigger http request to hit '/ping' url?

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


On Tue, Mar 27, 2018 at 6:05 PM, Wilhelm Wurzer 
wrote:

> From the about dialog:
>
> Version 2.1
> Python Version 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623
> (Red Hat 4.8.5-16)]
> Flask Version 0.11.1
>
> Wilhelm Wurzer
>
> --
> *Von: *"Murtuza Zabuawala" 
> *An: *"Wilhelm Wurzer" 
> *CC: *"pgadmin-hackers" 
> *Gesendet: *Dienstag, 27. März 2018 14:30:27
> *Betreff: *Re: pgadmin healthcheck-url
>
> What is the pgAdmin4 version?
>
>
> On Tue, Mar 27, 2018 at 5:54 PM, Wilhelm Wurzer 
> wrote:
>
>> Hi,
>>
>> thanks, but a cookie / session-file is still created:
>>
>> Request URL: http://xxx.com/misc/ping
>> Request Method: GET
>> Status Code: 200 OK
>>
>> Response:
>> Date: Tue, 27 Mar 2018 12:17:55 GMT
>> Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_wsgi/3.4
>> Python/2.7.5
>> Set-Cookie: 
>> pga4_session="23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU/eIy5kQqoGUU+QD8+VRo=";
>> Expires=Wed, 28-Mar-2018 12:17:55 GMT; HttpOnly; Path=/
>>
>> FileSystem:
>>
>> 4 -rw-r--r-- 1 48 48 162 27. Mär 12:17 23068f07-c448-4054-9654-95a9cf
>> 1f700f
>>
>> best regards,
>> Wilhelm Wurzer
>>
>> --
>> *Von: *"Murtuza Zabuawala" 
>> *An: *"Wilhelm Wurzer" 
>> *CC: *"pgadmin-hackers" 
>> *Gesendet: *Dienstag, 27. März 2018 13:51:56
>> *Betreff: *Re: pgadmin healthcheck-url
>>
>> You can use '/misc/ping' route to check if pgAdmin4 is running.
>>
>> Example: http://localhost:5050/misc/ping
>>
>> On Success you will get,
>> Status code: 200
>> Response text: PING
>>
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wurzer 
>> wrote:
>>
>>> Hi,
>>>
>>> we are using pgadmin in a docker container on aws. To ensure that the
>>> container is up and running, a healthcheck is periodically checking via
>>> http, restarting the container if neccessary.
>>>
>>> When checking the filesystem, we found that for each request, a session
>>> file is created. Healthcheck is done twice every 30secs, so we have about
>>> 5600 session files a day. (about 100k after a few days..)
>>>
>>>
>>> I looked at the sourcecode and found that in session.py, line 259 it
>>> looks like cookies should not be created for static resources
>>>
>>> -
>>>
>>> def open_session(self, app, request):
>>> cookie_val = request.cookies.get(app.session_cookie_name)
>>>
>>> if not cookie_val or '!' not in cookie_val:
>>> # Don't bother creating a cookie for static resources
>>> for sp in self.skip_paths:
>>> if request.path.startswith(sp):
>>> return None
>>>
>>> -
>>>
>>> unfortunately, in __init__.py, when setting up the session interface,
>>> skip_paths is empty and so a cookie gets created also for static resources
>>> (i'm no python hacker, so maybe i'm missing something)
>>>
>>>
>>> So my question is - is there an url that can be used for healthchecking,
>>> that does not create a session file on every check ?
>>>
>>>
>>> thanks a lot,
>>>
>>> Wilhelm Wurzer
>>> twyn group GmbH
>>>
>>>
>>
>>
>
>


Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-27 Thread Murtuza Zabuawala
On Tue, Mar 27, 2018 at 7:06 PM, Robert Eckhardt 
wrote:

>
>
> On Tue, Mar 27, 2018 at 6:25 AM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> On Tue, Mar 27, 2018 at 3:13 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt 
>>> wrote:
>>>


 On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
 jdealmeidapere...@pivotal.io> wrote:

> Hi Hackers,
>
> @Murtuza: The patch codewise looks good. Nice to see that we are using
> axios instead of jquery ajax calls and that there is some coverage for the
> change.
> Nevertheless the Javascript testing looks a bit slim and could be
> improved. Also the DataSorting class could have some other member 
> functions
> like the model validation could be extracted out so that it is easily
> tested.
>
>
> @Hackers: This was how we tried to test this feature:
> 1 - Started pgAdmin
> 2 - Opened the query tool for a specific server
> 3 - Executed a SQL statment
> 4 - Pressed the column header to try to order, nothing happened
> 5 - Right clicked the column header to see if it was there the option,
> nothing
>
> This is the behavior that we were expecting, not to have to open Data
> View and then press the icon that is not even near the grid in order to
> sort the column. Is this really the way we want people to use the grid in
> pgAdmin? Should it be more intuitive?
>

 Have we considered making the grid behave more like excel or other
 grids? I think that having the ascending and descending inside the column
 header, we could similarly provide filtering. Something that would give
 users a more intuitive place to look.

>>>
>>> Doing the sorting via header clicks is convenient but very restrictive.
>>> How do you specify multiple columns to sort by for example? The current
>>> design allows you to select columns and the sort order as you see fit.
>>>
>>
> Honestly I'm not sold on my idea, I was just proposing an alternative in
> an effort to start a discussion about the user experience. Ideally what I'd
> like to see, maybe this happened, is some user research. When we initial
> worked on refactoring the results grid we made a bunch of changes. One of
> the things we intended to do was to follow up to see how people were using
> the grid now so that we could better understand how it was now being used
> in order to design and implement features just like this. Clearly we
> haven't gotten there yet.
>
>
>>
>> Another reason we can't use that because w
>> e have already occupied that behaviour for selecting entire column
>> ​ when user clicks on header.
>> As Dave suggested, I will be merging it with filter dialog meaning it
>> will be accessible via direct button on toolbar & keyboard shortcut.​
>> ​
>>
>
> How are users currently interacting with that filter dialog?
>

​By clicking on the toolbar button as well as keyboard shortcut.
​




>
> What I'm suggesting is that we understand how users want to interact with
> their results, be those the results of a query or a table view, then we can
> design something that meets those needs. I agree that changing the column
> selection behavior isn't desirable, however, I also feel like providing the
> best user experience is better than holding onto a particular feature
> implementation.
> ​
>
>

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


Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-27 Thread Robert Eckhardt
On Tue, Mar 27, 2018 at 6:25 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> On Tue, Mar 27, 2018 at 3:13 PM, Dave Page  wrote:
>
>>
>>
>> On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt 
>> wrote:
>>
>>>
>>>
>>> On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hi Hackers,

 @Murtuza: The patch codewise looks good. Nice to see that we are using
 axios instead of jquery ajax calls and that there is some coverage for the
 change.
 Nevertheless the Javascript testing looks a bit slim and could be
 improved. Also the DataSorting class could have some other member functions
 like the model validation could be extracted out so that it is easily
 tested.


 @Hackers: This was how we tried to test this feature:
 1 - Started pgAdmin
 2 - Opened the query tool for a specific server
 3 - Executed a SQL statment
 4 - Pressed the column header to try to order, nothing happened
 5 - Right clicked the column header to see if it was there the option,
 nothing

 This is the behavior that we were expecting, not to have to open Data
 View and then press the icon that is not even near the grid in order to
 sort the column. Is this really the way we want people to use the grid in
 pgAdmin? Should it be more intuitive?

>>>
>>> Have we considered making the grid behave more like excel or other
>>> grids? I think that having the ascending and descending inside the column
>>> header, we could similarly provide filtering. Something that would give
>>> users a more intuitive place to look.
>>>
>>
>> Doing the sorting via header clicks is convenient but very restrictive.
>> How do you specify multiple columns to sort by for example? The current
>> design allows you to select columns and the sort order as you see fit.
>>
>
Honestly I'm not sold on my idea, I was just proposing an alternative in an
effort to start a discussion about the user experience. Ideally what I'd
like to see, maybe this happened, is some user research. When we initial
worked on refactoring the results grid we made a bunch of changes. One of
the things we intended to do was to follow up to see how people were using
the grid now so that we could better understand how it was now being used
in order to design and implement features just like this. Clearly we
haven't gotten there yet.


>
> Another reason we can't use that because w
> e have already occupied that behaviour for selecting entire column
> ​ when user clicks on header.
> As Dave suggested, I will be merging it with filter dialog meaning it will
> be accessible via direct button on toolbar & keyboard shortcut.​
> ​
>

How are users currently interacting with that filter dialog?

What I'm suggesting is that we understand how users want to interact with
their results, be those the results of a query or a table view, then we can
design something that meets those needs. I agree that changing the column
selection behavior isn't desirable, however, I also feel like providing the
best user experience is better than holding onto a particular feature
implementation.

-- Rob


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


Re: [pgAdmin4][patch]: RM #3090 pgadmin shows misleading "Query returned successfully" with incorrect SQL

2018-03-27 Thread Joao De Almeida Pereira
Hi Akshay,

We were not trying to imply that your fix did not solve the problem, we
were trying to understand the root cause of the problem.

1. We were not able to reproduce the problem
We followed your directions in RM, removed your fix but we could not
reproduce the problem. So we could not make sure that the application is in
fact working. This maybe have been because we missed something.
2. The fix does not tackle the big problem
>From what we read on the RM the big problem is "when we throw an exception
the front end is displaying the query successful message". Did you also
understood that from the RM?
We believe this is the real problem behind the RM.
Were you able replicate this behavior? If so we need to address the root of
this.


As an aside sniping bugs is fine in some situations but as a general rule
of thumb is a bad approach and creates a blob of code that no one can
manage. A situation like this look like a very promising candidate for
extraction/refactoring in our point of view. In which situation do you
normally refactor or extract code?

Thanks
Joao

On Tue, Mar 27, 2018, 1:31 AM Akshay Joshi 
wrote:

> Hi Joao
>
> On Tue, Mar 27, 2018 at 12:01 AM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello,
>> We tried to reproduce the issue but we were not capable to reproduce it.
>> What it is strange on the fix is that python is complaining about a
>> different line then the one that was fixed. Maybe this is just a Python
>> thing
>>
>
> I have mentioned the steps in RM and I have tried it on Ubuntu 16.
> Python is complaining the exact line where I have fixed the logic.
>
>ex_diag_message = u"{0}:  {1}".format(
>  self.decode_to_utf8(exception_obj.diag.severity), # 
> exception_obj.diag.severity is not decoded before my fix.
>  self.decode_to_utf8(exception_obj.diag.message_primary)
>)
>
>
>
>>
>> I assume that the fix works, but I would love to see some tests to ensure
>> it is working. Another issue that looks more problematic is the fact that,
>> as per the Redmine issue, when an exception is thrown it sends back a
>> Successful Query message. If this is the case then this fix doesn't look
>> like it is enough to solve the problem.
>>
>
> Yes it works. With the latest code I didn't see Successful Query
> message, it is showing "Not connected to the server .", but the stack
> trace is same that was mentioned in the RM.
>
>>
>> Thanks
>> Victoria & Joao
>>
>> On Mon, Mar 26, 2018 at 9:00 AM Dave Page  wrote:
>>
>>> Thanks, applied.
>>>
>>> On Mon, Mar 26, 2018 at 11:43 AM, Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Hackers,

 Please find the attached patch to fix RM #3090 pgadmin shows
 misleading "Query returned successfully" with incorrect SQL.

 --
 *Akshay Joshi*

 *Sr. Software Architect *



 *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
 976-788-8246 <+91%2097678%2088246>*

>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246
> <+91%2097678%2088246>*
>


Re: pgadmin healthcheck-url

2018-03-27 Thread Wilhelm Wurzer
>From the about dialog: 

Version 2.1 
Python Version 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red 
Hat 4.8.5-16)] 
Flask Version 0.11.1 

Wilhelm Wurzer 


Von: "Murtuza Zabuawala"  
An: "Wilhelm Wurzer"  
CC: "pgadmin-hackers"  
Gesendet: Dienstag, 27. März 2018 14:30:27 
Betreff: Re: pgadmin healthcheck-url 

What is the pgAdmin4 version? 


On Tue, Mar 27, 2018 at 5:54 PM, Wilhelm Wurzer < wilhelm.wur...@twyn.com > 
wrote: 



Hi, 

thanks, but a cookie / session-file is still created: 

Request URL: http://xxx.com/misc/ping 
Request Method: GET 
Status Code: 200 OK 

Response: 
Date: Tue, 27 Mar 2018 12:17:55 GMT 
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_wsgi/3.4 Python/2.7.5 
Set-Cookie: 
pga4_session="23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU/eIy5kQqoGUU+QD8+VRo=";
 Expires=Wed, 28-Mar-2018 12:17:55 GMT; HttpOnly; Path=/ 

FileSystem: 

4 -rw-r--r-- 1 48 48 162 27. Mär 12:17 23068f07-c448-4054-9654-95a9cf1f700f 

best regards, 
Wilhelm Wurzer 


Von: "Murtuza Zabuawala" < murtuza.zabuaw...@enterprisedb.com > 
An: "Wilhelm Wurzer" < wilhelm.wur...@twyn.com > 
CC: "pgadmin-hackers" < pgadmin-hackers@lists.postgresql.org > 
Gesendet: Dienstag, 27. März 2018 13:51:56 
Betreff: Re: pgadmin healthcheck-url 

You can use ' /misc/ping ' route to check if pgAdmin4 is running. 

Example: http://localhost:5050/misc/ping 

On Success you will get, 
Status code: 200 
Response text: PING 


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


On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wurzer < wilhelm.wur...@twyn.com > 
wrote: 

BQ_BEGIN
Hi, 

we are using pgadmin in a docker container on aws. To ensure that the container 
is up and running, a healthcheck is periodically checking via http, restarting 
the container if neccessary. 

When checking the filesystem, we found that for each request, a session file is 
created. Healthcheck is done twice every 30secs, so we have about 5600 session 
files a day. (about 100k after a few days..) 


I looked at the sourcecode and found that in session.py, line 259 it looks like 
cookies should not be created for static resources 

- 

def open_session(self, app, request): 
cookie_val = request.cookies.get(app.session_cookie_name) 

if not cookie_val or '!' not in cookie_val: 
# Don't bother creating a cookie for static resources 
for sp in self.skip_paths: 
if request.path.startswith(sp): 
return None 

- 

unfortunately, in __init__.py, when setting up the session interface, 
skip_paths is empty and so a cookie gets created also for static resources (i'm 
no python hacker, so maybe i'm missing something) 


So my question is - is there an url that can be used for healthchecking, that 
does not create a session file on every check ? 


thanks a lot, 

Wilhelm Wurzer 
twyn group GmbH 







BQ_END





Re: pgadmin healthcheck-url

2018-03-27 Thread Murtuza Zabuawala
What is the pgAdmin4 version?


On Tue, Mar 27, 2018 at 5:54 PM, Wilhelm Wurzer 
wrote:

> Hi,
>
> thanks, but a cookie / session-file is still created:
>
> Request URL: http://xxx.com/misc/ping
> Request Method: GET
> Status Code: 200 OK
>
> Response:
> Date: Tue, 27 Mar 2018 12:17:55 GMT
> Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_wsgi/3.4 Python/2.7.5
> Set-Cookie: 
> pga4_session="23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU/eIy5kQqoGUU+QD8+VRo=";
> Expires=Wed, 28-Mar-2018 12:17:55 GMT; HttpOnly; Path=/
>
> FileSystem:
>
> 4 -rw-r--r-- 1 48 48 162 27. Mär 12:17 23068f07-c448-4054-9654-
> 95a9cf1f700f
>
> best regards,
> Wilhelm Wurzer
>
> --
> *Von: *"Murtuza Zabuawala" 
> *An: *"Wilhelm Wurzer" 
> *CC: *"pgadmin-hackers" 
> *Gesendet: *Dienstag, 27. März 2018 13:51:56
> *Betreff: *Re: pgadmin healthcheck-url
>
> You can use '/misc/ping' route to check if pgAdmin4 is running.
>
> Example: http://localhost:5050/misc/ping
>
> On Success you will get,
> Status code: 200
> Response text: PING
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wurzer 
> wrote:
>
>> Hi,
>>
>> we are using pgadmin in a docker container on aws. To ensure that the
>> container is up and running, a healthcheck is periodically checking via
>> http, restarting the container if neccessary.
>>
>> When checking the filesystem, we found that for each request, a session
>> file is created. Healthcheck is done twice every 30secs, so we have about
>> 5600 session files a day. (about 100k after a few days..)
>>
>>
>> I looked at the sourcecode and found that in session.py, line 259 it
>> looks like cookies should not be created for static resources
>>
>> -
>>
>> def open_session(self, app, request):
>> cookie_val = request.cookies.get(app.session_cookie_name)
>>
>> if not cookie_val or '!' not in cookie_val:
>> # Don't bother creating a cookie for static resources
>> for sp in self.skip_paths:
>> if request.path.startswith(sp):
>> return None
>>
>> -
>>
>> unfortunately, in __init__.py, when setting up the session interface,
>> skip_paths is empty and so a cookie gets created also for static resources
>> (i'm no python hacker, so maybe i'm missing something)
>>
>>
>> So my question is - is there an url that can be used for healthchecking,
>> that does not create a session file on every check ?
>>
>>
>> thanks a lot,
>>
>> Wilhelm Wurzer
>> twyn group GmbH
>>
>>
>
>


Re: pgadmin healthcheck-url

2018-03-27 Thread Wilhelm Wurzer
Hi, 

thanks, but a cookie / session-file is still created: 

Request URL: http://xxx.com/misc/ping 
Request Method: GET 
Status Code: 200 OK 

Response: 
Date: Tue, 27 Mar 2018 12:17:55 GMT 
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_wsgi/3.4 Python/2.7.5 
Set-Cookie: 
pga4_session="23068f07-c448-4054-9654-95a9cf1f700f!rK2x2rU/eIy5kQqoGUU+QD8+VRo=";
 Expires=Wed, 28-Mar-2018 12:17:55 GMT; HttpOnly; Path=/ 

FileSystem: 

4 -rw-r--r-- 1 48 48 162 27. Mär 12:17 23068f07-c448-4054-9654-95a9cf1f700f 

best regards, 
Wilhelm Wurzer 


Von: "Murtuza Zabuawala"  
An: "Wilhelm Wurzer"  
CC: "pgadmin-hackers"  
Gesendet: Dienstag, 27. März 2018 13:51:56 
Betreff: Re: pgadmin healthcheck-url 

You can use ' /misc/ping ' route to check if pgAdmin4 is running. 

Example: http://localhost:5050/misc/ping 

On Success you will get, 
Status code: 200 
Response text: PING 


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


On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wurzer < wilhelm.wur...@twyn.com > 
wrote: 


Hi, 

we are using pgadmin in a docker container on aws. To ensure that the container 
is up and running, a healthcheck is periodically checking via http, restarting 
the container if neccessary. 

When checking the filesystem, we found that for each request, a session file is 
created. Healthcheck is done twice every 30secs, so we have about 5600 session 
files a day. (about 100k after a few days..) 


I looked at the sourcecode and found that in session.py, line 259 it looks like 
cookies should not be created for static resources 

- 

def open_session(self, app, request): 
cookie_val = request.cookies.get(app.session_cookie_name) 

if not cookie_val or '!' not in cookie_val: 
# Don't bother creating a cookie for static resources 
for sp in self.skip_paths: 
if request.path.startswith(sp): 
return None 

- 

unfortunately, in __init__.py, when setting up the session interface, 
skip_paths is empty and so a cookie gets created also for static resources (i'm 
no python hacker, so maybe i'm missing something) 


So my question is - is there an url that can be used for healthchecking, that 
does not create a session file on every check ? 


thanks a lot, 

Wilhelm Wurzer 
twyn group GmbH 








Re: pgadmin healthcheck-url

2018-03-27 Thread Murtuza Zabuawala
You can use '/misc/ping' route to check if pgAdmin4 is running.

Example: http://localhost:5050/misc/ping

On Success you will get,
Status code: 200
Response text: PING


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


On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wurzer 
wrote:

> Hi,
>
> we are using pgadmin in a docker container on aws. To ensure that the
> container is up and running, a healthcheck is periodically checking via
> http, restarting the container if neccessary.
>
> When checking the filesystem, we found that for each request, a session
> file is created. Healthcheck is done twice every 30secs, so we have about
> 5600 session files a day. (about 100k after a few days..)
>
>
> I looked at the sourcecode and found that in session.py, line 259 it looks
> like cookies should not be created for static resources
>
> -
>
> def open_session(self, app, request):
> cookie_val = request.cookies.get(app.session_cookie_name)
>
> if not cookie_val or '!' not in cookie_val:
> # Don't bother creating a cookie for static resources
> for sp in self.skip_paths:
> if request.path.startswith(sp):
> return None
>
> -
>
> unfortunately, in __init__.py, when setting up the session interface,
> skip_paths is empty and so a cookie gets created also for static resources
> (i'm no python hacker, so maybe i'm missing something)
>
>
> So my question is - is there an url that can be used for healthchecking,
> that does not create a session file on every check ?
>
>
> thanks a lot,
>
> Wilhelm Wurzer
> twyn group GmbH
>
>


pgadmin healthcheck-url

2018-03-27 Thread Wilhelm Wurzer
Hi, 

we are using pgadmin in a docker container on aws. To ensure that the container 
is up and running, a healthcheck is periodically checking via http, restarting 
the container if neccessary. 

When checking the filesystem, we found that for each request, a session file is 
created. Healthcheck is done twice every 30secs, so we have about 5600 session 
files a day. (about 100k after a few days..)


I looked at the sourcecode and found that in session.py, line 259 it looks like 
cookies should not be created for static resources

-

def open_session(self, app, request): 
cookie_val = request.cookies.get(app.session_cookie_name) 

if not cookie_val or '!' not in cookie_val: 
# Don't bother creating a cookie for static resources 
for sp in self.skip_paths: 
if request.path.startswith(sp): 
return None

-

unfortunately, in __init__.py, when setting up the session interface, 
skip_paths is empty and so a cookie gets created also for static resources (i'm 
no python hacker, so maybe i'm missing something)


So my question is - is there an url that can be used for healthchecking, that 
does not create a session file on every check ?


thanks a lot,

Wilhelm Wurzer 
twyn group GmbH 



Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-27 Thread Dave Page
On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt 
wrote:

>
>
> On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Hackers,
>>
>> @Murtuza: The patch codewise looks good. Nice to see that we are using
>> axios instead of jquery ajax calls and that there is some coverage for the
>> change.
>> Nevertheless the Javascript testing looks a bit slim and could be
>> improved. Also the DataSorting class could have some other member functions
>> like the model validation could be extracted out so that it is easily
>> tested.
>>
>>
>> @Hackers: This was how we tried to test this feature:
>> 1 - Started pgAdmin
>> 2 - Opened the query tool for a specific server
>> 3 - Executed a SQL statment
>> 4 - Pressed the column header to try to order, nothing happened
>> 5 - Right clicked the column header to see if it was there the option,
>> nothing
>>
>> This is the behavior that we were expecting, not to have to open Data
>> View and then press the icon that is not even near the grid in order to
>> sort the column. Is this really the way we want people to use the grid in
>> pgAdmin? Should it be more intuitive?
>>
>
> Have we considered making the grid behave more like excel or other grids?
> I think that having the ascending and descending inside the column header,
> we could similarly provide filtering. Something that would give users a
> more intuitive place to look.
>

Doing the sorting via header clicks is convenient but very restrictive. How
do you specify multiple columns to sort by for example? The current design
allows you to select columns and the sort order as you see fit.

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

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