pgAdmin 4 commit: Python 2.6 support is officially deprecated.

2018-12-20 Thread Dave Page
Python 2.6 support is officially deprecated.

Branch
--
master

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

Modified Files
--
README   | 4 ++--
pkg/mac/README.txt   | 2 +-
pkg/pip/setup_pip.py | 2 +-
pkg/win32/README.txt | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)



Re: [pgAdmin4][Patch] - RM 3780 pgAdmin4 lacks ability to specify NULL values in CSV export

2018-12-20 Thread Dave Page
Hi

When testing with quoting set to None, quote = " and delimiter = , I get
the following exception when I try to download:

2018-12-20 09:34:02,547: SQL pgadmin: Execute (with server cursor) for
server #2 - CONN:354106 (Query-id: 4121147):
SELECT NULL::text, 1234::int, 'Foo bar'::text, E'Foo\nBar'::text
2018-12-20 09:34:02,570: INFO werkzeug: 127.0.0.1 - - [20/Dec/2018
09:34:02] "GET
/sqleditor/query_tool/download/5610522?query=SELECT%20NULL%3A%3Atext%2C%201234%3A%3Aint%2C%20%27Foo%20bar%27%3A%3Atext%2C%20E%27Foo%5CnBar%27%3A%3Atext&filename=data-1545298442530.csv
HTTP/1.1" 500 -
2018-12-20 09:34:02,572: ERROR werkzeug: Error on request:
Traceback (most recent call last):
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/serving.py",
line 270, in run_wsgi
execute(self.server.app)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/serving.py",
line 260, in execute
for data in application_iter:
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/wsgi.py",
line 870, in __next__
return self._next()
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/wrappers.py",
line 82, in _iter_encoded
for item in iterable:
  File
"/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py",
line 820, in gen
csv_writer.writerows(results)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 748, in
writerows
return self.writer.writerows(map(self._dict_to_list, rowdicts))
  File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 256, in
writerows
self.writerow(row)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 249, in
writerow
row = [self.strategy.prepare(field, only=only) for field in row]
  File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 249, in

row = [self.strategy.prepare(field, only=only) for field in row]
  File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 136, in
prepare
raise Error('No escapechar is set')
_csv.Error: No escapechar is set

When I have quoting set to All, the first column is returned as ""

dpage@hal:*~/Downloads*$ more data-1545298598112.csv

"text","int4","text-2","text-3"

"","1234","Foo bar","Foo

Bar"

Isn't the point for it to be NULL?

On Tue, Dec 18, 2018 at 11:13 AM Akshay Joshi 
wrote:

> Hi Dave
>
> Attached is the modified patch to fix review comments.
>
> On Tue, Dec 18, 2018 at 3:00 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>>
>>
>> On Tue, Dec 18, 2018 at 2:49 PM Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Tue, Dec 18, 2018 at 3:45 AM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Hackers,

 Attached is the patch to fix RM #3780 pgAdmin4 lacks ability to specify
 NULL values in CSV export.

 Please review it.

>>>
>>> A few points;
>>>
>>> - You've included code from backports.csv, but per the licence you need
>>> to include a description of the changes made.
>>>
>>
>>   Sure. In that case I'll copy the complete file and will do my
>> changes which is of two lines only. With my patch I have remove all the
>> unwanted code from backport.csv.
>>
>>>
>>> - Shouldn't backports.csv be removed from requirements.txt, or is it
>>> used elsewhere?
>>>
>>
>>  Yes. Will do that.
>>
>>>
>>> - If the previous point is true, then I'm fairly sure there is code in
>>> one or more of the many package build scripts that adds an __init__.py file
>>> to backports.csv in the venv that's created.
>>>
>>
>> I'll remove that code as well.
>>
>>>
>>> --
>>> 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-9517Mobile: +91 976-788-8246*
>>
>
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>


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

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


pgAdmin 4 commit: Ensure the dashboard tabs are styles correctly. Fixes

2018-12-20 Thread Dave Page
Ensure the dashboard tabs are styles correctly. Fixes #3824

Branch
--
master

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

Modified Files
--
.../dashboard/templates/dashboard/database_dashboard.html |  9 ++---
.../dashboard/templates/dashboard/server_dashboard.html   | 12 
web/pgadmin/static/scss/_bootstrap.overrides.scss | 15 +--
3 files changed, 27 insertions(+), 9 deletions(-)



Re: [pgAdmin4] [RM#3824] Make bootstrap tabs visible on dashboard

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

On Tue, Dec 18, 2018 at 2:34 PM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please ignore my previous patch.
>
> Here is an updated patch which includes tab hover CSS changes as well.
>
>
> On Tue, Dec 18, 2018 at 7:46 PM Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Here is updated patch, Please review.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>>
>> On Tue, Dec 18, 2018 at 3:30 PM Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Mon, Dec 17, 2018 at 11:38 AM Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi,

 PFA patch which will make the bootstrap tabs visible when active and
 also when the user hovers on them.

>>>
>>> It does what it says, but the styling doesn't match the rest of the tabs
>>> in the application. Can you make them look like the wcDocker tabs please
>>> (except, with the colours reversed as they are - white background for the
>>> bar and inactive tabs instead of grey, white for the active tab instead of
>>> gray).
>>>
>>> Thanks!
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>

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

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


pgAdmin 4 commit: Ensure identifiers are properly displayed in the plan

2018-12-20 Thread Dave Page
Ensure identifiers are properly displayed in the plan viewer. Fixes #3821

Branch
--
master

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

Modified Files
--
docs/en_US/release_notes_3_7.rst   |  3 +-
.../xss_checks_panels_and_query_tool_test.py   | 77 +-
web/pgadmin/misc/static/explain/js/explain.js  | 13 +++-
.../misc/static/explain/js/explain_statistics.js   | 45 +
4 files changed, 120 insertions(+), 18 deletions(-)



pgAdmin 4 commit: Tweak the wording on the Grant Wizard. Fixes #3796

2018-12-20 Thread Dave Page
Tweak the wording on the Grant Wizard. Fixes #3796

Branch
--
master

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

Modified Files
--
docs/en_US/release_notes_3_7.rst   | 1 +
web/pgadmin/messages.pot   |  8848 
.../tools/grant_wizard/static/js/grant_wizard.js   | 6 +-
.../translations/de/LC_MESSAGES/messages.po|  9493 +
.../translations/es/LC_MESSAGES/messages.po|  9669 +
.../translations/fr/LC_MESSAGES/messages.po| 10375 +--
.../translations/ja/LC_MESSAGES/messages.po|  9597 +
.../translations/ko/LC_MESSAGES/messages.po|  9583 +
.../translations/pl/LC_MESSAGES/messages.po|  9553 +
.../translations/ru/LC_MESSAGES/messages.po|  9555 +
.../translations/zh/LC_MESSAGES/messages.po|  9461 +
11 files changed, 21823 insertions(+), 64318 deletions(-)



Re: [pgAdmin4][Patch]: RM 3796 - Grant Wizard: Text should be "Please add privileges..." instead of "Please select privileges..

2018-12-20 Thread Dave Page
Thanks, applied along with some additional tweaks.
On Wed, Dec 19, 2018 at 9:30 AM Khushboo Vashi
 wrote:
>
> Hi,
>
> Please find the attached minor patch to fix #3796 - Grant Wizard: Text should 
> be "Please add privileges..." instead of "Please select privileges..."
>
> Thanks,
> Khushboo



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

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



pgAdmin 4 commit: Ensure table definitions include WHERE clauses on EXC

2018-12-20 Thread Dave Page
Ensure table definitions include WHERE clauses on EXCLUDE constraints. Fixes 
#3726

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=ffae65bdbe403d84204bc1b1f9ed348166324c44
Author: Aditya Toshniwal 

Modified Files
--
.../schemas/tables/templates/table/sql/macros/constraints.macro   | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



Re: [pgAdmin4][RM3726] EXCLUDE constraint omits WHERE clause

2018-12-20 Thread Dave Page
Thanks, patch applied.
On Wed, Dec 19, 2018 at 12:19 PM Aditya Toshniwal
 wrote:
>
> Hi Hackers,
>
> The table definition change was missing in the last patch. Attached is the 
> part2 for RM3726 which will fix the table definition also.
>
> Kindly review.
>
> On Tue, Dec 18, 2018 at 7:07 PM Dave Page  wrote:
>>
>> Thanks, applied.
>> On Mon, Dec 17, 2018 at 11:59 AM Aditya Toshniwal
>>  wrote:
>> >
>> > Hi Hackers,
>> >
>> > Attached is the patch to fix the issue where EXLUDE constraint SQL missed 
>> > the WHERE clause.
>> >
>> > Kindly review.
>> >
>> > --
>> > Thanks and Regards,
>> > Aditya Toshniwal
>> > Software Engineer | EnterpriseDB Software Solutions | Pune
>> > "Don't Complain about Heat, Plant a tree"
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"



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

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



Re: [pgAdmin 4][Patch]: RM 3559 - Far too many mouse clicks to drill down in Browser

2018-12-20 Thread Dave Page
Hi

On Tue, Dec 18, 2018 at 9:46 AM Khushboo Vashi
 wrote:
>
> Hi,
>
> Please find the attached patch to fix the issue reported in RM #3559 (Far too 
> many mouse clicks to drill down in Browser) related to Tree Save State.
> This RM was updated by the user with the issues in the browser tree state 
> save functionality with the reproduction steps. These issues have been fixed 
> in the attached patch.

Thanks - whilst the patch seems to work (based on the description you
sent me that I've pasted below for reference), I do see a problem.
Basically, the first time I try to re-open a server that has a
previously-saved state, the Databases node underneath it shows with an
indefinite busy indicator. I can still use the tree under it - and if
I then refresh the entire browser, the problem goes away and doesn't
come back. Refreshing the node doesn't help though.

> The fixed issues:
>
> 1. Expand any database > Close the database node > Refresh the Server.
> Issue - The closed database opens up even if we have closed before 
> Refreshing the server.
> 2.  Expand 3 to 4 databases till Table node with the same schema name (Ex; 
> Public) > Refresh the browser
> Issue - Not all the Table nodes will expand, it will expand till Schema 
> only
> 3. Expand any database till Table > Close the database node > Refresh the 
> Browser
> Issue - When I open the database node, it does not open the tree till 
> Table node


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

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



pgAdmin 4 commit: Add a copyright update tool.

2018-12-20 Thread Dave Page
Add a copyright update tool.

Branch
--
master

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

Modified Files
--
tools/copyright_updater.py | 102 +
1 file changed, 102 insertions(+)



[pgAdmin4][RM3830] AttributeError if pgadmin4-web-setup.sh stopped in between login setup and run again

2018-12-20 Thread Aditya Toshniwal
Hi Hackers,

Attached is patch to fix the exception "AttributeError: 'NoneType' object
has no attribute 'value'", which occurs when you stop(Ctrl+Z or
Ctrl+C) pgadmin4-web-setup.sh
script while entering details for login and then run pgadmin4-web-setup.sh
again. pgAdmin4 fails to start thereafter.

Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"


RM3830.patch
Description: Binary data


pgAdmin 4 commit: Use the standard copyright string.

2018-12-20 Thread Dave Page
Use the standard copyright string.

Branch
--
master

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

Modified Files
--
web/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgAdmin 4 commit: Don't lose the comma!

2018-12-20 Thread Dave Page
Don't lose the comma!

Branch
--
master

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

Modified Files
--
tools/copyright_updater.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



Re: [pgAdmin] [RM#3831] Utility script to update copyright information

2018-12-20 Thread Dave Page
Hi

Thanks - committed with a few minor changes:

- Message tweaks
- Don't lose the comma after the second year, or the tool will only work once
- Put it in a new utilities/ directory
- Scan .pro and .plist files as well.
On Thu, Dec 20, 2018 at 7:55 AM Murtuza Zabuawala
 wrote:
>
> Hi Dave,
>
> Please find an updated patch.
>
> (Happy holidays)
>
> On Wed, 19 Dec 2018, 20:56 Dave Page >
>> Hi
>> On Wed, Dec 19, 2018 at 2:33 PM Murtuza Zabuawala 
>>  wrote:
>>>
>>> Hi,
>>>
>>> Please find the utility script which will allow us to update the copyright 
>>> information in one shot.
>>>
>>> Usage:
>>> python copyright_updater.py  
>>> python copyright_updater.py 2018 2019
>>>
>>> Please review.
>>
>>
>> Neat. But...
>>
>> Changing copyright information of file: 
>> `/Users/dpage/git/postgresql/contrib/unaccent/sql/unaccent.sql`
>>
>> Traceback (most recent call last):
>>
>>   File "web/copyright_updater.py", line 80, in 
>>
>> files_affected = findReplace('..', sys.argv[1], sys.argv[2])
>>
>>   File "web/copyright_updater.py", line 47, in findReplace
>>
>> content = fp.read()
>>
>>   File "/Users/dpage/.virtualenvs/pgadmin4/bin/../lib/python3.6/codecs.py", 
>> line 321, in decode
>>
>> (result, consumed) = self._buffer_decode(data, self.errors, final)
>>
>> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 164: 
>> invalid start byte
>>
>>
>> :-(
>>
>> --
>> 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



Re: [pgAdmin4][Patch] - RM 3780 pgAdmin4 lacks ability to specify NULL values in CSV export

2018-12-20 Thread Dave Page
Hi

On Thu, Dec 20, 2018 at 10:09 AM Akshay Joshi 
wrote:

> Hi Dave
>
> On Thu, Dec 20, 2018 at 3:08 PM Dave Page  wrote:
>
>> Hi
>>
>> When testing with quoting set to None, quote = " and delimiter = , I get
>> the following exception when I try to download:
>>
>> 2018-12-20 09:34:02,547: SQL pgadmin: Execute (with server cursor) for
>> server #2 - CONN:354106 (Query-id: 4121147):
>> SELECT NULL::text, 1234::int, 'Foo bar'::text, E'Foo\nBar'::text
>> 2018-12-20 09:34:02,570: INFO werkzeug: 127.0.0.1 - - [20/Dec/2018
>> 09:34:02] "GET
>> /sqleditor/query_tool/download/5610522?query=SELECT%20NULL%3A%3Atext%2C%201234%3A%3Aint%2C%20%27Foo%20bar%27%3A%3Atext%2C%20E%27Foo%5CnBar%27%3A%3Atext&filename=data-1545298442530.csv
>> HTTP/1.1" 500 -
>> 2018-12-20 09:34:02,572: ERROR werkzeug: Error on request:
>> Traceback (most recent call last):
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/serving.py",
>> line 270, in run_wsgi
>> execute(self.server.app)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/serving.py",
>> line 260, in execute
>> for data in application_iter:
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/wsgi.py",
>> line 870, in __next__
>> return self._next()
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/wrappers.py",
>> line 82, in _iter_encoded
>> for item in iterable:
>>   File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py",
>> line 820, in gen
>> csv_writer.writerows(results)
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 748, in
>> writerows
>> return self.writer.writerows(map(self._dict_to_list, rowdicts))
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 256, in
>> writerows
>> self.writerow(row)
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 249, in
>> writerow
>> row = [self.strategy.prepare(field, only=only) for field in row]
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 249, in
>> 
>> row = [self.strategy.prepare(field, only=only) for field in row]
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 136, in
>> prepare
>> raise Error('No escapechar is set')
>> _csv.Error: No escapechar is set
>>
>
> Not able to reproduce the above issue. I have tested it with the same
> setting as you mentioned. Please refer all the attached screenshots. Please
> specify the steps if they are different.
>
>>
>> When I have quoting set to All, the first column is returned as ""
>>
>> dpage@hal:*~/Downloads*$ more data-1545298598112.csv
>>
>> "text","int4","text-2","text-3"
>>
>> "","1234","Foo bar","Foo
>>
>> Bar"
>>
>> Isn't the point for it to be NULL?
>>
>
> while quoting is set to ALL, all the data types has been quoted, so I
> thought null values should be replaced by "" instead of blank. But if you
> think null values shouldn't be quoted even if user select quote ALL, I'll
> fix it and resend the patch.
>

So how would you distinguish NULL from an empty string? Isn't that exactly
what the bug is about?

I still think we need a "Replace NULLs with" config option, and regardless
of quoting settings we always replace NULL values with whatever that is set
to  - for which the user could then choose options like:

NULL
"NULL"
""
''


We would never quote the NULL replacement value - if the user wanted it to
be quoted, they would include the quotes in the configured string.


>
>> On Tue, Dec 18, 2018 at 11:13 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Dave
>>>
>>> Attached is the modified patch to fix review comments.
>>>
>>> On Tue, Dec 18, 2018 at 3:00 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>


 On Tue, Dec 18, 2018 at 2:49 PM Dave Page  wrote:

> Hi
>
> On Tue, Dec 18, 2018 at 3:45 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> Attached is the patch to fix RM #3780 pgAdmin4 lacks ability to
>> specify NULL values in CSV export.
>>
>> Please review it.
>>
>
> A few points;
>
> - You've included code from backports.csv, but per the licence you
> need to include a description of the changes made.
>

   Sure. In that case I'll copy the complete file and will do my
 changes which is of two lines only. With my patch I have remove all the
 unwanted code from backport.csv.

>
> - Shouldn't backports.csv be removed from requirements.txt, or is it
> used elsewhere?
>

  Yes. Will do that.

>
> - If the previous point is true, then I'm fairly sure there is code in
> one or more of the many package build scripts that adds an __init__.py 
> file
> to backports.csv in the venv that's created.
>

 I'll remove that code as well.
>

Re: [pgAdmin 4][Patch]: RM 3559 - Far too many mouse clicks to drill down in Browser

2018-12-20 Thread Khushboo Vashi
On Thu, Dec 20, 2018 at 4:01 PM Dave Page  wrote:

> Hi
>
> On Tue, Dec 18, 2018 at 9:46 AM Khushboo Vashi
>  wrote:
> >
> > Hi,
> >
> > Please find the attached patch to fix the issue reported in RM #3559
> (Far too many mouse clicks to drill down in Browser) related to Tree Save
> State.
> > This RM was updated by the user with the issues in the browser tree
> state save functionality with the reproduction steps. These issues have
> been fixed in the attached patch.
>
> Thanks - whilst the patch seems to work (based on the description you
> sent me that I've pasted below for reference), I do see a problem.
> Basically, the first time I try to re-open a server that has a
> previously-saved state, the Databases node underneath it shows with an
> indefinite busy indicator. I can still use the tree under it - and if
> I then refresh the entire browser, the problem goes away and doesn't
> come back. Refreshing the node doesn't help though.
>
> I have slightly changed the data structure, may be it is causing the issue.
Please find the attached updated patch with the fix.

> > The fixed issues:
> >
> > 1. Expand any database > Close the database node > Refresh the Server.
> > Issue - The closed database opens up even if we have closed before
> Refreshing the server.
> > 2.  Expand 3 to 4 databases till Table node with the same schema name
> (Ex; Public) > Refresh the browser
> > Issue - Not all the Table nodes will expand, it will expand till
> Schema only
> > 3. Expand any database till Table > Close the database node > Refresh
> the Browser
> > Issue - When I open the database node, it does not open the tree
> till Table node
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM_3559_v1.patch
Description: Binary data


Re: [pgAdmin4][Patch] - RM 3780 pgAdmin4 lacks ability to specify NULL values in CSV export

2018-12-20 Thread Akshay Joshi
On Thu, Dec 20, 2018 at 4:48 PM Dave Page  wrote:

> Hi
>
> On Thu, Dec 20, 2018 at 10:09 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Dave
>>
>> On Thu, Dec 20, 2018 at 3:08 PM Dave Page  wrote:
>>
>>> Hi
>>>
>>> When testing with quoting set to None, quote = " and delimiter = , I get
>>> the following exception when I try to download:
>>>
>>> 2018-12-20 09:34:02,547: SQL pgadmin: Execute (with server cursor) for
>>> server #2 - CONN:354106 (Query-id: 4121147):
>>> SELECT NULL::text, 1234::int, 'Foo bar'::text, E'Foo\nBar'::text
>>> 2018-12-20 09:34:02,570: INFO werkzeug: 127.0.0.1 - - [20/Dec/2018
>>> 09:34:02] "GET
>>> /sqleditor/query_tool/download/5610522?query=SELECT%20NULL%3A%3Atext%2C%201234%3A%3Aint%2C%20%27Foo%20bar%27%3A%3Atext%2C%20E%27Foo%5CnBar%27%3A%3Atext&filename=data-1545298442530.csv
>>> HTTP/1.1" 500 -
>>> 2018-12-20 09:34:02,572: ERROR werkzeug: Error on request:
>>> Traceback (most recent call last):
>>>   File
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/serving.py",
>>> line 270, in run_wsgi
>>> execute(self.server.app)
>>>   File
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/serving.py",
>>> line 260, in execute
>>> for data in application_iter:
>>>   File
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/wsgi.py",
>>> line 870, in __next__
>>> return self._next()
>>>   File
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python3.6/site-packages/werkzeug/wrappers.py",
>>> line 82, in _iter_encoded
>>> for item in iterable:
>>>   File
>>> "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py",
>>> line 820, in gen
>>> csv_writer.writerows(results)
>>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 748,
>>> in writerows
>>> return self.writer.writerows(map(self._dict_to_list, rowdicts))
>>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 256,
>>> in writerows
>>> self.writerow(row)
>>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 249,
>>> in writerow
>>> row = [self.strategy.prepare(field, only=only) for field in row]
>>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 249,
>>> in 
>>> row = [self.strategy.prepare(field, only=only) for field in row]
>>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/csv.py", line 136,
>>> in prepare
>>> raise Error('No escapechar is set')
>>> _csv.Error: No escapechar is set
>>>
>>
>> Not able to reproduce the above issue. I have tested it with the same
>> setting as you mentioned. Please refer all the attached screenshots. Please
>> specify the steps if they are different.
>>
>>>
>>> When I have quoting set to All, the first column is returned as ""
>>>
>>> dpage@hal:*~/Downloads*$ more data-1545298598112.csv
>>>
>>> "text","int4","text-2","text-3"
>>>
>>> "","1234","Foo bar","Foo
>>>
>>> Bar"
>>>
>>> Isn't the point for it to be NULL?
>>>
>>
>> while quoting is set to ALL, all the data types has been quoted, so I
>> thought null values should be replaced by "" instead of blank. But if you
>> think null values shouldn't be quoted even if user select quote ALL, I'll
>> fix it and resend the patch.
>>
>
> So how would you distinguish NULL from an empty string? Isn't that exactly
> what the bug is about?
>
> I still think we need a "Replace NULLs with" config option, and regardless
> of quoting settings we always replace NULL values with whatever that is set
> to  - for which the user could then choose options like:
>
> NULL
> "NULL"
> ""
> ''
> 
>
> We would never quote the NULL replacement value - if the user wanted it to
> be quoted, they would include the quotes in the configured string.
>


   OK, Will work on it and send the modified patch again.

>
>
>>
>>> On Tue, Dec 18, 2018 at 11:13 AM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Dave

 Attached is the modified patch to fix review comments.

 On Tue, Dec 18, 2018 at 3:00 PM Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

>
>
> On Tue, Dec 18, 2018 at 2:49 PM Dave Page  wrote:
>
>> Hi
>>
>> On Tue, Dec 18, 2018 at 3:45 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Hackers,
>>>
>>> Attached is the patch to fix RM #3780 pgAdmin4 lacks ability to
>>> specify NULL values in CSV export.
>>>
>>> Please review it.
>>>
>>
>> A few points;
>>
>> - You've included code from backports.csv, but per the licence you
>> need to include a description of the changes made.
>>
>
>   Sure. In that case I'll copy the complete file and will do my
> changes which is of two lines only. With my patch I have remove all the
> unwanted code from backport.csv.
>
>>
>> - Shouldn't backports.csv be removed from requirements.txt, or is it
>> used elsewhere?
>>
>
>>>