F5 - irritating behaviour

2017-11-02 Thread Johann Spies
On Debian in Firefox

If I terminate a running query, change it and press F5 again, a
notification jumps up asking me whether I want to leave the page!

Then I have to use the mouse to activate the query again.

I am not actually sure whether it is always after a query was terminated
that this happens.  I am just getting a bit fed-up with this behaviour.

Is there a way to get Ctl-E back as it was on pgadmin3?

Regards
Johann
-- 
Johann SpiesTelefoon: 021-808 4699
Databestuurder /  Data manager  Faks: 021-883 3691

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology 
Universiteit Stellenbosch.

The integrity and confidentiality of this email is governed by these terms / 
Hierdie terme bepaal die integriteit en vertroulikheid van hierdie epos. 
http://www.sun.ac.za/emaildisclaimer



Re: F5 - irritating behaviour

2017-11-02 Thread Dave Page
On Thu, Nov 2, 2017 at 9:35 AM, Johann Spies  wrote:

> On Debian in Firefox
>
> If I terminate a running query, change it and press F5 again, a
> notification jumps up asking me whether I want to leave the page!
>
> Then I have to use the mouse to activate the query again.
>

It sounds like Firefox is grabbing the keypress. That shouldn't happen as
long as the query tool has focus. Is that the case?


>
> I am not actually sure whether it is always after a query was terminated
> that this happens.  I am just getting a bit fed-up with this behaviour.
>
> Is there a way to get Ctl-E back as it was on pgadmin3?
>

I honestly had no idea Ctrl+E worked in pgAdmin III. The documented key was
F5 there too.

We are looking into the idea of making shortcut keys configurable, so that
may solve this.


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

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


Re: Multiple head revisions after git pull (2.0rc1 --> 2.0)

2017-11-02 Thread Willy-Bas Loos
Just to clarify, this is not a git question

Op 1 nov. 2017 12:19 p.m. schreef "Willy-Bas Loos" :

> Hi,
>
> After my stash & pull to upgrade from 2.0rc1 to 2.0, these commands both
> end in the error below.
>
>- ../web$ FLASK_APP=pgAdmin4.py flask db revision
>- ../web$ python pgAdmin4.py
>
>
> File "/home/wbloos/.virtualenvs/pgadmin4/lib/python3.5/site-
> packages/alembic/script/revision.py", line 270, in get_current_head
> "%s@head" % branch_label if branch_label else "head")
> alembic.util.exc.CommandError: Multiple head revisions are present for
> given argument 'head'; please specify a specific target revision,
> '@head' to narrow to a specific head, or 'heads' for all heads
>
> I use Version: webpack 3.6.0
>
> Any tips?
>
> Cheers,
> --
> Willy-Bas Loos
>


Re: Multiple head revisions after git pull (2.0rc1 --> 2.0)

2017-11-02 Thread Murtuza Zabuawala
I suspect you have some local revisions, Could you run below command and
see if you have any local revisions?

../web$ FLASK_APP=pgAdmin4.py flask db history

You can compare it with what we(pgadmin4) have in revision history,
...
...
d85a62333272 -> ef590e979b0d (head), empty message
f195f9a4923d -> d85a62333272, empty message
3c1e4b6eda55 -> f195f9a4923d, Encrypt the existing user password.
09d53fca90c7 -> 3c1e4b6eda55, empty message
fdc58d9bd449 -> 09d53fca90c7, Update DB to version 14
 -> fdc58d9bd449, Initial database creation


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


On Thu, Nov 2, 2017 at 3:37 PM, Willy-Bas Loos  wrote:

> Just to clarify, this is not a git question
>
> Op 1 nov. 2017 12:19 p.m. schreef "Willy-Bas Loos" :
>
>> Hi,
>>
>> After my stash & pull to upgrade from 2.0rc1 to 2.0, these commands both
>> end in the error below.
>>
>>- ../web$ FLASK_APP=pgAdmin4.py flask db revision
>>- ../web$ python pgAdmin4.py
>>
>>
>> File "/home/wbloos/.virtualenvs/pgadmin4/lib/python3.5/site-packa
>> ges/alembic/script/revision.py", line 270, in get_current_head
>> "%s@head" % branch_label if branch_label else "head")
>> alembic.util.exc.CommandError: Multiple head revisions are present for
>> given argument 'head'; please specify a specific target revision,
>> '@head' to narrow to a specific head, or 'heads' for all heads
>>
>> I use Version: webpack 3.6.0
>>
>> Any tips?
>>
>> Cheers,
>> --
>> Willy-Bas Loos
>>
>


Re: F5 - irritating behaviour

2017-11-02 Thread Johann Spies
On Thu, Nov 02, 2017 at 09:44:27AM +, Dave Page wrote:
> On Thu, Nov 2, 2017 at 9:35 AM, Johann Spies  wrote:
> 
> 
> It sounds like Firefox is grabbing the keypress. That shouldn't happen as
> long as the query tool has focus. Is that the case?

Yes. After editing the query (after terminating it) when I press F5...


> We are looking into the idea of making shortcut keys configurable, so that
> may solve this.

Thanks. That will be useful.

Regards
Johann
-- 
Johann SpiesTelefoon: 021-808 4699
Databestuurder /  Data manager  Faks: 021-883 3691

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology 
Universiteit Stellenbosch.

The integrity and confidentiality of this email is governed by these terms / 
Hierdie terme bepaal die integriteit en vertroulikheid van hierdie epos. 
http://www.sun.ac.za/emaildisclaimer



Re: F5 - irritating behaviour

2017-11-02 Thread Magnus Hagander
On Thu, Nov 2, 2017 at 10:44 AM, Dave Page  wrote:

>
>
> On Thu, Nov 2, 2017 at 9:35 AM, Johann Spies  wrote:
>
>> On Debian in Firefox
>>
>> If I terminate a running query, change it and press F5 again, a
>> notification jumps up asking me whether I want to leave the page!
>>
>> Then I have to use the mouse to activate the query again.
>>
>
> It sounds like Firefox is grabbing the keypress. That shouldn't happen as
> long as the query tool has focus. Is that the case?
>

Arguably it is pgadmin that expects to grab it from Firefox :) It's
actually pretty horrible in general that a website *can* hijack hotkeys
from the browser. I have issues with this all the time in other web systems
(haven't really had a problem with pgadmin, but it's the same general
thing) given that some hotkeys are different in different locales and the
developers didn't consider that.



> I am not actually sure whether it is always after a query was terminated
>> that this happens.  I am just getting a bit fed-up with this behaviour.
>>
>> Is there a way to get Ctl-E back as it was on pgadmin3?
>>
>
> I honestly had no idea Ctrl+E worked in pgAdmin III. The documented key
> was F5 there too.
>

I used Ctrl-E all the time :)



> We are looking into the idea of making shortcut keys configurable, so that
> may solve this.
>


That would indeed be great, and would solve the more general case I
mentioned above as well (which I'm sure hurts somebody in some locale
already).

//Magnus


Output format of explain

2017-11-02 Thread Johann Spies
Maybe because I do not spend enough time in reading the output of
"explain" results, I made use of the website https://explain.depesz.com/
in the past to quickly identify the problem areas in complicated
queries.

Now I cannot do it as the output is in json format and there is (as far
as I could figure out) not an option to change the format.

Or is there?

Regards
Johann
-- 
Johann SpiesTelefoon: 021-808 4699
Databestuurder /  Data manager  Faks: 021-883 3691

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology 
Universiteit Stellenbosch.

The integrity and confidentiality of this email is governed by these terms / 
Hierdie terme bepaal die integriteit en vertroulikheid van hierdie epos. 
http://www.sun.ac.za/emaildisclaimer



Re: Output format of explain

2017-11-02 Thread Dave Page
On Thu, Nov 2, 2017 at 1:34 PM, Johann Spies  wrote:

> Maybe because I do not spend enough time in reading the output of
> "explain" results, I made use of the website https://explain.depesz.com/
> in the past to quickly identify the problem areas in complicated
> queries.
>
> Now I cannot do it as the output is in json format and there is (as far
> as I could figure out) not an option to change the format.
>
> Or is there?
>

No, because JSON is what pgAdmin knows how to interpret so that's what it
requests to render the plan etc.

If you want other formats, you can run the explain query directly, e.g.

EXPLAIN SELECT ...


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

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


ordinal not in range when downloading result set as CSV

2017-11-02 Thread Erik Myllymaki
I"m trying to download the result set of a SQL query to csv and I get 
this error:


'ascii' codec can't encode character u'\ufeff' in position 33: ordinal 
not in range(128)


Any pointers appreciated, thanks.

This on Ubuntu 16.04:

*Version*
2.0
*Copyright*
Copyright 2013 - 2017, The pgAdmin Development Team
*Python Version*
2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
*Flask Version*
0.11.1
*Application Mode*
Desktop


Re: F5 - irritating behaviour

2017-11-02 Thread Richard Greenwood
I've always used F5 to the point that's a reflex. I use pgAdmin4 in a
browser, usually Chrome, in server mode and about half the time F5 does
what I want (executes the query) and the other half the time it tries to
reload the page. It's annoying and I haven't figured out what triggers it.
Philosophically I agree with Magnus Hagander's comment that it's horrible
that a website can hijack hotkeys from the browser, but in this case I'm
happy to put philosophy aside and get my F5 key back to reliably executing
queries.

Rich




On Thu, Nov 2, 2017 at 7:34 AM, Magnus Hagander  wrote:

> On Thu, Nov 2, 2017 at 10:44 AM, Dave Page  wrote:
>
>>
>>
>> On Thu, Nov 2, 2017 at 9:35 AM, Johann Spies  wrote:
>>
>>> On Debian in Firefox
>>>
>>> If I terminate a running query, change it and press F5 again, a
>>> notification jumps up asking me whether I want to leave the page!
>>>
>>> Then I have to use the mouse to activate the query again.
>>>
>>
>> It sounds like Firefox is grabbing the keypress. That shouldn't happen as
>> long as the query tool has focus. Is that the case?
>>
>
> Arguably it is pgadmin that expects to grab it from Firefox :) It's
> actually pretty horrible in general that a website *can* hijack hotkeys
> from the browser. I have issues with this all the time in other web systems
> (haven't really had a problem with pgadmin, but it's the same general
> thing) given that some hotkeys are different in different locales and the
> developers didn't consider that.
>
>
>
>> I am not actually sure whether it is always after a query was terminated
>>> that this happens.  I am just getting a bit fed-up with this behaviour.
>>>
>>> Is there a way to get Ctl-E back as it was on pgadmin3?
>>>
>>
>> I honestly had no idea Ctrl+E worked in pgAdmin III. The documented key
>> was F5 there too.
>>
>
> I used Ctrl-E all the time :)
>
>
>
>> We are looking into the idea of making shortcut keys configurable, so
>> that may solve this.
>>
>
>
> That would indeed be great, and would solve the more general case I
> mentioned above as well (which I'm sure hurts somebody in some locale
> already).
>
> //Magnus
>
>


-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com


Re: ordinal not in range when downloading result set as CSV

2017-11-02 Thread Murtuza Zabuawala
This issue occurs when you have some encoded data which pgAdmin4 can't
decode while generating CSV file.

You can report this issue here
, Please also
include details to produce the issue​ (if possible also include some sample
data), PG version (encoding details), Platform (encoding details) etc.

On Fri, Nov 3, 2017 at 2:04 AM, Erik Myllymaki 
wrote:

> I"m trying to download the result set of a SQL query to csv and I get this
> error:
>
> 'ascii' codec can't encode character u'\ufeff' in position 33: ordinal not
> in range(128)
>
> Any pointers appreciated, thanks.
>
> This on Ubuntu 16.04:
> *Version*
> 2.0
> *Copyright*
> Copyright 2013 - 2017, The pgAdmin Development Team
> *Python Version*
> 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
> *Flask Version*
> 0.11.1
> *Application Mode*
> Desktop
>