Re: [pgAdmin4][Patch]: RM #2963 - Backup database, Restore database and Maintenance Database failed for é object.

2018-03-12 Thread Dave Page
Hi

On Mon, Mar 12, 2018 at 2:00 AM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

>
> Hi Dave,
>
> On Fri, Mar 9, 2018 at 9:09 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Fri, Mar 9, 2018 at 3:32 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Fri, Mar 9, 2018 at 3:54 AM, Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find the attached patch to fix below issues:

 1. #2963 - Backup database, Restore database and Maintenance Database
 failed for é object
 2. #3157 - Process viewer doesn't show complete command executed.

 Test cases are not included for these fixes as we don't have test cases
 for these modules (backup, restore, maintenance).
 I will create one separate RM for the same which will cover this.

>>>
>>> Interesting that you fix these together, as together they also exhibit
>>> another bug :-). Backing up the é database displays the following
>>> command:
>>>
>>> /usr/local/pgsql/bin/pg_dump --file "/Users/dpage/foo.bak" --host
>>> "localhost" --port "5432" --username "postgres" --no-password --verbose
>>> --format=c --blobs "é"
>>>
>>
>> I can reproduce this issue only with notification dialogue (which I have
> fixed in the attached patch) not with the details dialogue. Please refer
> the screenshots for the same.
>

Huh, interesting. What Python version were you using? I had 2.7.


> Also, what tests can we add for backup/restore? We have nothing at all at
>> the moment, and it is pretty troublesome. I'd like to ensure that we can
>> backup and restore a database correctly, and ensure that the displayed
>> commands are what we expect and that we get valid output from
>> pg_dump/pg_restore (though, it may change from PG version to PG version, so
>> maybe we should just check for something small and generic). I guess this
>> might need some config parameters for the tests to specify the pg_* utility
>> paths for each server.
>>
>> I'd suggest maybe having a feature test that opens the prefs, sets the
>> appropriate path, then runs a backup, waits for it to finish, checks the
>> process monitor output, then restores the same backup to a new database,
>> checking the process monitor output again, and then checking that the
>> restored database contains at least one object from the original database
>> (we don't need to check all of pg_dump/pg_restore, just that something
>> expected was restored). We should use a (partial) database name and backup
>> filename from the advanced test config file, and I think both should
>> default to some interesting non-ASCII strings to ensure quoting works.
>>
> I was thinking of writing the unit test cases for the processes.py file as
> all the major functionalities for backup/restore/maintenance jobs done by
> this file, but by this we can not achieve the front-end string validation
> esp for non-ASCII strings.
> So, I am thinking of writing feature tests (as you have suggested) first
> and after that if needed I will write unit test cases.
>

Sounds good. Let's try to keep the feature testing minimal, and expand the
coverage with unit tests.

Thanks!

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

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


Re: [pgAdmin4][Patch]: RM #2963 - Backup database, Restore database and Maintenance Database failed for é object.

2018-03-12 Thread Khushboo Vashi
On Mon, Mar 12, 2018 at 5:15 PM, Dave Page  wrote:

> Hi
>
> On Mon, Mar 12, 2018 at 2:00 AM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>>
>> Hi Dave,
>>
>> On Fri, Mar 9, 2018 at 9:09 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Fri, Mar 9, 2018 at 3:32 PM, Dave Page  wrote:
>>>
 Hi

 On Fri, Mar 9, 2018 at 3:54 AM, Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch to fix below issues:
>
> 1. #2963 - Backup database, Restore database and Maintenance Database
> failed for é object
> 2. #3157 - Process viewer doesn't show complete command executed.
>
> Test cases are not included for these fixes as we don't have test
> cases for these modules (backup, restore, maintenance).
> I will create one separate RM for the same which will cover this.
>

 Interesting that you fix these together, as together they also exhibit
 another bug :-). Backing up the é database displays the following
 command:

 /usr/local/pgsql/bin/pg_dump --file "/Users/dpage/foo.bak" --host
 "localhost" --port "5432" --username "postgres" --no-password --verbose
 --format=c --blobs "é"

>>>
>>> I can reproduce this issue only with notification dialogue (which I have
>> fixed in the attached patch) not with the details dialogue. Please refer
>> the screenshots for the same.
>>
>
> Huh, interesting. What Python version were you using? I had 2.7.
>
>
PY 2.7 and PY 3.5

> Also, what tests can we add for backup/restore? We have nothing at all at
>>> the moment, and it is pretty troublesome. I'd like to ensure that we can
>>> backup and restore a database correctly, and ensure that the displayed
>>> commands are what we expect and that we get valid output from
>>> pg_dump/pg_restore (though, it may change from PG version to PG version, so
>>> maybe we should just check for something small and generic). I guess this
>>> might need some config parameters for the tests to specify the pg_* utility
>>> paths for each server.
>>>
>>> I'd suggest maybe having a feature test that opens the prefs, sets the
>>> appropriate path, then runs a backup, waits for it to finish, checks the
>>> process monitor output, then restores the same backup to a new database,
>>> checking the process monitor output again, and then checking that the
>>> restored database contains at least one object from the original database
>>> (we don't need to check all of pg_dump/pg_restore, just that something
>>> expected was restored). We should use a (partial) database name and backup
>>> filename from the advanced test config file, and I think both should
>>> default to some interesting non-ASCII strings to ensure quoting works.
>>>
>> I was thinking of writing the unit test cases for the processes.py file
>> as all the major functionalities for backup/restore/maintenance jobs done
>> by this file, but by this we can not achieve the front-end string
>> validation esp for non-ASCII strings.
>> So, I am thinking of writing feature tests (as you have suggested) first
>> and after that if needed I will write unit test cases.
>>
>
> Sounds good. Let's try to keep the feature testing minimal, and expand the
> coverage with unit tests.
>
> Sure.

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


[pgAdmin4][RM#3139] Create proper template path if Windows

2018-03-12 Thread Murtuza Zabuawala
Hi,

PFA patch to correct the template path generation logic incase of Windows
system.

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


RM_3139.diff
Description: Binary data


Re: pgAdmin 4 commit: Support for external tables in GPDB. Fixes #3168

2018-03-12 Thread Murtuza Zabuawala
Hi Dave,

Joao's patch is pending, would you please do the needful?
I also encounter similar issue on Windows while running tests.

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


On Tue, Mar 6, 2018 at 8:25 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Neel,
>
> You can find attached the corrections of the path's needed for windows.
> The fix should correct TestExternalTablesView and TestTemplateCreate but
> for the ChangePasswordTestCase I need more information to help you out. We
> need to understand what is the response that the endpoint
> /user_management/user is returning.
>
> Thanks
> Joao
>
> On Tue, Mar 6, 2018 at 2:29 AM Neel Patel 
> wrote:
>
>> Hi Joao,
>>
>> I ran the testsuite in windows 10 with Python 3.4 and it fails for
>> external tables. Linux it is working fine. Let me know if I miss
>> anything.
>>
>> Please check the below logs.
>>
>> python runtests.py --pkg browser --exclude feature_tests
>>
>> 
>>
>> ==
>> ERROR: runTest (pgadmin.browser.server_groups.servers.databases.
>> schemas.tables.tests.test_template_create.TestTemplateCreate)
>> When rendering GreenPlum 5.3 template, when no distribution is present,
>> when no primary key is present, it returns "DISTRIBUTED RANDOMLY"
>> --
>> Traceback (most recent call last):
>>   File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\
>> servers\databases\schemas\tables\tests\test_template_create.py", line
>> 99, in runTest
>> self.template_path, **self.input_parameters)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>> line 133, in render_template
>> return _render(ctx.app.jinja_env.get_or_select_template(template_
>> name_or_list),
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>> line 830, in get_or_select_template
>> return self.get_template(template_name_or_list, parent, globals)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>> line 791, in get_template
>> return self._load_template(name, self.make_globals(globals))
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>> line 765, in _load_template
>> template = self.loader.load(self, name, globals)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.py",
>> line 113, in load
>> source, filename, uptodate = self.get_source(environment, name)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>> line 57, in get_source
>> return self._get_source_fast(environment, template)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>> line 85, in _get_source_fast
>> raise TemplateNotFound(template)
>> jinja2.exceptions.TemplateNotFound: table\sql\gpdb_5.0_plus\create.sql
>>
>> ==
>> ERROR: runTest (pgadmin.browser.server_groups.servers.databases.
>> schemas.tables.tests.test_template_create.TestTemplateCreate)
>> When rendering GreenPlum 5.3 template, when no distribution is present,
>> when primary key is present, it returns "DISTRIBUTED BY (attr_primary_key)"
>> --
>> Traceback (most recent call last):
>>   File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\
>> servers\databases\schemas\tables\tests\test_template_create.py", line
>> 99, in runTest
>> self.template_path, **self.input_parameters)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>> line 133, in render_template
>> return _render(ctx.app.jinja_env.get_or_select_template(template_
>> name_or_list),
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>> line 830, in get_or_select_template
>> return self.get_template(template_name_or_list, parent, globals)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>> line 791, in get_template
>> return self._load_template(name, self.make_globals(globals))
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>> line 765, in _load_template
>> template = self.loader.load(self, name, globals)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.py",
>> line 113, in load
>> source, filename, uptodate = self.get_source(environment, name)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>> line 57, in get_source
>> return self._get_source_fast(environment, template)
>>   File 
>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>> line 85, in _get_source_fas

Re: pgAdmin 4 commit: Support for external tables in GPDB. Fixes #3168

2018-03-12 Thread Murtuza Zabuawala
Hi Joao,

Can we make tests to skip if db is not greenplum?
Like we are doing for resource group
"..web/pgadmin/browser/server_groups/servers/resource_groups/tests".


On Mon, Mar 12, 2018 at 7:52 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> Joao's patch is pending, would you please do the needful?
> I also encounter similar issue on Windows while running tests.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Tue, Mar 6, 2018 at 8:25 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Neel,
>>
>> You can find attached the corrections of the path's needed for windows.
>> The fix should correct TestExternalTablesView and TestTemplateCreate but
>> for the ChangePasswordTestCase I need more information to help you out. We
>> need to understand what is the response that the endpoint
>> /user_management/user is returning.
>>
>> Thanks
>> Joao
>>
>> On Tue, Mar 6, 2018 at 2:29 AM Neel Patel 
>> wrote:
>>
>>> Hi Joao,
>>>
>>> I ran the testsuite in windows 10 with Python 3.4 and it fails for
>>> external tables. Linux it is working fine. Let me know if I miss
>>> anything.
>>>
>>> Please check the below logs.
>>>
>>> python runtests.py --pkg browser --exclude feature_tests
>>>
>>> 
>>>
>>> ==
>>> ERROR: runTest (pgadmin.browser.server_groups.servers.databases.schemas.
>>> tables.tests.test_template_create.TestTemplateCreate)
>>> When rendering GreenPlum 5.3 template, when no distribution is present,
>>> when no primary key is present, it returns "DISTRIBUTED RANDOMLY"
>>> --
>>> Traceback (most recent call last):
>>>   File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv
>>> ers\databases\schemas\tables\tests\test_template_create.py", line 99,
>>> in runTest
>>> self.template_path, **self.input_parameters)
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>>> line 133, in render_template
>>> return _render(ctx.app.jinja_env.get_or_select_template(template_na
>>> me_or_list),
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>>> line 830, in get_or_select_template
>>> return self.get_template(template_name_or_list, parent, globals)
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>>> line 791, in get_template
>>> return self._load_template(name, self.make_globals(globals))
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>>> line 765, in _load_template
>>> template = self.loader.load(self, name, globals)
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.py",
>>> line 113, in load
>>> source, filename, uptodate = self.get_source(environment, name)
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>>> line 57, in get_source
>>> return self._get_source_fast(environment, template)
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>>> line 85, in _get_source_fast
>>> raise TemplateNotFound(template)
>>> jinja2.exceptions.TemplateNotFound: table\sql\gpdb_5.0_plus\create.sql
>>>
>>> ==
>>> ERROR: runTest (pgadmin.browser.server_groups.servers.databases.schemas.
>>> tables.tests.test_template_create.TestTemplateCreate)
>>> When rendering GreenPlum 5.3 template, when no distribution is present,
>>> when primary key is present, it returns "DISTRIBUTED BY (attr_primary_key)"
>>> --
>>> Traceback (most recent call last):
>>>   File "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\serv
>>> ers\databases\schemas\tables\tests\test_template_create.py", line 99,
>>> in runTest
>>> self.template_path, **self.input_parameters)
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
>>> line 133, in render_template
>>> return _render(ctx.app.jinja_env.get_or_select_template(template_na
>>> me_or_list),
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>>> line 830, in get_or_select_template
>>> return self.get_template(template_name_or_list, parent, globals)
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>>> line 791, in get_template
>>> return self._load_template(name, self.make_globals(globals))
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
>>> line 765, in _load_template
>>> template = self.loader.load(self, name, globals)
>>>   File 
>>> "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.

pgAdmin 4 commit: Add support for connecting using pg_service.conf file

2018-03-12 Thread Dave Page
Add support for connecting using pg_service.conf files. Fixes #3140

Branch
--
master

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

Modified Files
--
docs/en_US/images/server_connection.png|  Bin 39678 -> 66243 bytes
docs/en_US/server_dialog.rst   |1 +
web/migrations/versions/50aad68f99c2_.py   |   82 +
.../browser/server_groups/servers/__init__.py  |   61 +-
.../server_groups/servers/static/js/server.js  |   48 +-
.../tests/test_add_server_with_service_id.py   |   47 +
web/pgadmin/model/__init__.py  |5 +-
web/pgadmin/utils/driver/psycopg2/__init__.py  | 1985 +---
web/pgadmin/utils/driver/psycopg2/connection.py| 1682 +
.../utils/driver/psycopg2/server_manager.py|  333 
10 files changed, 2227 insertions(+), 2017 deletions(-)



Re: [pgAdmin4][RM#3140] Add service parameter

2018-03-12 Thread Dave Page
Thanks, patch applied!

On Mon, Mar 12, 2018 at 3:31 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> PFA updated patch.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Fri, Mar 9, 2018 at 9:29 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> I'll change the name and send you updated patch.
>>
>>
>> On Fri, Mar 9, 2018 at 9:25 PM, Dave Page  wrote:
>>
>>> HI
>>>
>>> On Fri, Mar 9, 2018 at 11:47 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi,

 PFA patch to add service parameter in server dialog.
 - Docs updated
 - Test case added for Service ID parameter

 Please note,
 I have extracted Connection class and Server manager class from our own
 custom Psycopg2 driver module.

 Patch also covers RM#3120

>>>
>>>  This patch seems a little confused. The "Service" and "Service ID"
>>> fields from pgAdmin 3 are very different things. The Redmine ticket seems
>>> to be asking for the Service field (the pg_service.conf service name),
>>> *not* Service ID (the operating system's service ID, used to start/stop the
>>> database server service).
>>>
>>> --
>>> 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 #2963 - Backup database, Restore database and Maintenance Database failed for é object.

2018-03-12 Thread Dave Page
So I was trying to test this, and every time I try to run a backup, I'm
getting the following, with or without your patch:

(sqlite3.ProgrammingError) You must not use 8-bit bytestrings unless you
use a text_factory that can interpret 8-bit bytestrings (like text_factory
= str). It is highly recommended that you instead just switch your
application to Unicode strings. [SQL: u'INSERT INTO process (pid, user_id,
command, "desc", arguments, logdir, start_time, end_time, exit_code,
acknowledge) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters:
(180312205250107339, 1, u'/Library/PostgreSQL/9.4/bin/pg_dump',
'ccopy_reg\n_reconstructor\np0\n(cpgadmin.tools.backup\nBackupMessage\np1\nc__builtin__\nobject\np2\nNtp3\nRp4\n(dp5\nS\'cmd\'\np6\nV
--file "/Users/dpage/foo.dmp" --host "127.0.0.1" --port "5432" --username
"postgres" --no-password --verbose --format=c --blobs
"\xe9"\np7\nsS\'backup_type\'\np8\nI3\nsS\'database\'\np9\nV\xe9\np10\nsS\'bfile\'\np11\nS\'foo.dmp\'\np12\nsS\'sid\'\np13\nI1\nsb.',
u'--file,/Users/dpage/foo.dmp,--host,127.0.0.1,--port,5432,--username,postgres,--no-password,--verbose,--format=c,--blobs,\xe9',
'/var/lib/pgadmin/sessions/process_logs/180312205250107339', None, None,
None, None)]

Any thoughts as to what's going on? I wasn't getting this on my other
laptop, and I can't think what else we would have changed to cause this.

On Mon, Mar 12, 2018 at 2:00 AM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

>
> Hi Dave,
>
> On Fri, Mar 9, 2018 at 9:09 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Fri, Mar 9, 2018 at 3:32 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Fri, Mar 9, 2018 at 3:54 AM, Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find the attached patch to fix below issues:

 1. #2963 - Backup database, Restore database and Maintenance Database
 failed for é object
 2. #3157 - Process viewer doesn't show complete command executed.

 Test cases are not included for these fixes as we don't have test cases
 for these modules (backup, restore, maintenance).
 I will create one separate RM for the same which will cover this.

>>>
>>> Interesting that you fix these together, as together they also exhibit
>>> another bug :-). Backing up the é database displays the following
>>> command:
>>>
>>> /usr/local/pgsql/bin/pg_dump --file "/Users/dpage/foo.bak" --host
>>> "localhost" --port "5432" --username "postgres" --no-password --verbose
>>> --format=c --blobs "é"
>>>
>>
>> I can reproduce this issue only with notification dialogue (which I have
> fixed in the attached patch) not with the details dialogue. Please refer
> the screenshots for the same.
>
>> Also, what tests can we add for backup/restore? We have nothing at all at
>> the moment, and it is pretty troublesome. I'd like to ensure that we can
>> backup and restore a database correctly, and ensure that the displayed
>> commands are what we expect and that we get valid output from
>> pg_dump/pg_restore (though, it may change from PG version to PG version, so
>> maybe we should just check for something small and generic). I guess this
>> might need some config parameters for the tests to specify the pg_* utility
>> paths for each server.
>>
>> I'd suggest maybe having a feature test that opens the prefs, sets the
>> appropriate path, then runs a backup, waits for it to finish, checks the
>> process monitor output, then restores the same backup to a new database,
>> checking the process monitor output again, and then checking that the
>> restored database contains at least one object from the original database
>> (we don't need to check all of pg_dump/pg_restore, just that something
>> expected was restored). We should use a (partial) database name and backup
>> filename from the advanced test config file, and I think both should
>> default to some interesting non-ASCII strings to ensure quoting works.
>>
> I was thinking of writing the unit test cases for the processes.py file as
> all the major functionalities for backup/restore/maintenance jobs done by
> this file, but by this we can not achieve the front-end string validation
> esp for non-ASCII strings.
> So, I am thinking of writing feature tests (as you have suggested) first
> and after that if needed I will write unit test cases.
>
>>
>> --
>> 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: pgAdmin 4 commit: Support for external tables in GPDB. Fixes #3168

2018-03-12 Thread Joao De Almeida Pereira
Hello Murtuza,
Yes I think it makes sense

Thanks
Joao

On Mon, Mar 12, 2018 at 10:40 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Joao,
>
> Can we make tests to skip if db is not greenplum?
> Like we are doing for resource group
> "..web/pgadmin/browser/server_groups/servers/resource_groups/tests".
>
>
> On Mon, Mar 12, 2018 at 7:52 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Joao's patch is pending, would you please do the needful?
>> I also encounter similar issue on Windows while running tests.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Tue, Mar 6, 2018 at 8:25 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hello Neel,
>>>
>>> You can find attached the corrections of the path's needed for windows.
>>> The fix should correct TestExternalTablesView and TestTemplateCreate
>>> but for the ChangePasswordTestCase I need more information to help you out.
>>> We need to understand what is the response that the endpoint
>>> /user_management/user is returning.
>>>
>>> Thanks
>>> Joao
>>>
>>> On Tue, Mar 6, 2018 at 2:29 AM Neel Patel 
>>> wrote:
>>>
 Hi Joao,

 I ran the testsuite in windows 10 with Python 3.4 and it fails for
 external tables. Linux it is working fine. Let me know if I miss
 anything.

 Please check the below logs.

 python runtests.py --pkg browser --exclude feature_tests

 

 ==
 ERROR: runTest
 (pgadmin.browser.server_groups.servers.databases.schemas.tables.tests.test_template_create.TestTemplateCreate)
 When rendering GreenPlum 5.3 template, when no distribution is present,
 when no primary key is present, it returns "DISTRIBUTED RANDOMLY"
 --
 Traceback (most recent call last):
   File
 "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\servers\databases\schemas\tables\tests\test_template_create.py",
 line 99, in runTest
 self.template_path, **self.input_parameters)
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
 line 133, in render_template
 return
 _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
 line 830, in get_or_select_template
 return self.get_template(template_name_or_list, parent, globals)
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
 line 791, in get_template
 return self._load_template(name, self.make_globals(globals))
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
 line 765, in _load_template
 template = self.loader.load(self, name, globals)
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\loaders.py",
 line 113, in load
 source, filename, uptodate = self.get_source(environment, name)
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
 line 57, in get_source
 return self._get_source_fast(environment, template)
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
 line 85, in _get_source_fast
 raise TemplateNotFound(template)
 jinja2.exceptions.TemplateNotFound: table\sql\gpdb_5.0_plus\create.sql

 ==
 ERROR: runTest
 (pgadmin.browser.server_groups.servers.databases.schemas.tables.tests.test_template_create.TestTemplateCreate)
 When rendering GreenPlum 5.3 template, when no distribution is present,
 when primary key is present, it returns "DISTRIBUTED BY (attr_primary_key)"
 --
 Traceback (most recent call last):
   File
 "C:\Projects\pgadmin4\web\pgadmin\browser\server_groups\servers\databases\schemas\tables\tests\test_template_create.py",
 line 99, in runTest
 self.template_path, **self.input_parameters)
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\flask\templating.py",
 line 133, in render_template
 return
 _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
 line 830, in get_or_select_template
 return self.get_template(template_name_or_list, parent, globals)
   File
 "C:\Projects\venv_pgadmin4_py_3_4\lib\site-packages\jinja2\environment.py",
 line 791, in get_template
 return self._load_template(name, self.make_globals(globals))

Re: [pgAdmin4][RM#3140] Add service parameter

2018-03-12 Thread Joao De Almeida Pereira
Hi Dave and Murtuza,

Regarding this patch we refactored the Javascript code so that is lives in
a different file and added some tests.

Also we found an issue with karma-jasmine that does not allow us to use
jasmine 3.1 yet. You can find attached a patch that reverts that commit.

Thanks
Victoria && Joao

On Mon, Mar 12, 2018 at 4:46 PM Dave Page  wrote:

> Thanks, patch applied!
>
> On Mon, Mar 12, 2018 at 3:31 AM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> PFA updated patch.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Fri, Mar 9, 2018 at 9:29 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> I'll change the name and send you updated patch.
>>>
>>>
>>> On Fri, Mar 9, 2018 at 9:25 PM, Dave Page  wrote:
>>>
 HI

 On Fri, Mar 9, 2018 at 11:47 AM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to add service parameter in server dialog.
> - Docs updated
> - Test case added for Service ID parameter
>
> Please note,
> I have extracted Connection class and Server manager class from our
> own custom Psycopg2 driver module.
>
> Patch also covers RM#3120
>

  This patch seems a little confused. The "Service" and "Service ID"
 fields from pgAdmin 3 are very different things. The Redmine ticket seems
 to be asking for the Service field (the pg_service.conf service name),
 *not* Service ID (the operating system's service ID, used to start/stop the
 database server service).

 --
 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/package.json b/web/package.json
index ad0f3e16..66684fc6 100644
--- a/web/package.json
+++ b/web/package.json
@@ -69,6 +69,7 @@
 "hard-source-webpack-plugin": "^0.4.9",
 "immutability-helper": "^2.2.0",
 "imports-loader": "^0.7.1",
+"ip-address": "^5.8.9",
 "jquery": "1.11.2",
 "jquery-contextmenu": "^2.5.0",
 "jquery-ui": "^1.12.1",
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 53be2255..302fe458 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -2,10 +2,13 @@ define('pgadmin.node.server', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
   'pgadmin.server.supported_servers', 'pgadmin.user_management.current_user',
-  'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.browser.server.privilege',
+  'pgadmin.alertifyjs', 'pgadmin.backform',
+  'sources/browser/server_groups/servers/model_validation',
+  'pgadmin.browser.server.privilege',
 ], function(
   gettext, url_for, $, _, Backbone, S, pgAdmin, pgBrowser,
-  supported_servers, current_user, Alertify, Backform
+  supported_servers, current_user, Alertify, Backform,
+  modelValidation
 ) {
 
   if (!pgBrowser.Nodes['server']) {
@@ -848,110 +851,8 @@ define('pgadmin.node.server', [
   group: gettext('Connection'),
 }],
 validate: function() {
-  var err = {},
-errmsg,
-self = this;
-
-  var service_id = this.get('service');
-
-  var check_for_empty = function(id, msg) {
-var v = self.get(id);
-if (
-  _.isUndefined(v) || v === null || String(v).replace(/^\s+|\s+$/g, '') == ''
-) {
-  err[id] = msg;
-  errmsg = errmsg || msg;
-  return true;
-} else {
-  self.errorModel.unset(id);
-  return false;
-}
-  };
-  var check_for_valid_ipv6 = function(val){
-// Regular expression for validating IPv6 address formats
-var exps = ['^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|',
-  '(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|',
-  '2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|',
-  '(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|',
-  ':((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|',
-  '(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|',
-  '2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|',
-  '(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0

Re: [pgAdmin4][RM#3139] Create proper template path if Windows

2018-03-12 Thread Dave Page
Hi

On Mon, Mar 12, 2018 at 10:15 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to correct the template path generation logic incase of Windows
> system.
>

Seems like it would be better to fix it the other way round to me - e.g.
update the template loader to use os.path.join.

Any reason not to do that?

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

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


Re: [pgAdmin4][RM#3140] Add service parameter

2018-03-12 Thread Dave Page
Hi

On Mon, Mar 12, 2018 at 5:18 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Dave and Murtuza,
>
> Regarding this patch we refactored the Javascript code so that is lives in
> a different file and added some tests.
>
> Also we found an issue with karma-jasmine that does not allow us to use
> jasmine 3.1 yet. You can find attached a patch that reverts that commit.
>

Sounds good, but neither patch will apply (in fact, the Jasmine one looks
entirely backwards). One of the error messages was changed in Murtuza's
patch, and wasn't reflected in your update for example.

Can you rebase please?

Thanks.


>
> Thanks
> Victoria && Joao
>
> On Mon, Mar 12, 2018 at 4:46 PM Dave Page  wrote:
>
>> Thanks, patch applied!
>>
>> On Mon, Mar 12, 2018 at 3:31 AM, Murtuza Zabuawala > enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> PFA updated patch.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>>> On Fri, Mar 9, 2018 at 9:29 PM, Murtuza Zabuawala >> enterprisedb.com> wrote:
>>>
 Hi Dave,

 I'll change the name and send you updated patch.


 On Fri, Mar 9, 2018 at 9:25 PM, Dave Page  wrote:

> HI
>
> On Fri, Mar 9, 2018 at 11:47 AM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch to add service parameter in server dialog.
>> - Docs updated
>> - Test case added for Service ID parameter
>>
>> Please note,
>> I have extracted Connection class and Server manager class from our
>> own custom Psycopg2 driver module.
>>
>> Patch also covers RM#3120
>>
>
>  This patch seems a little confused. The "Service" and "Service ID"
> fields from pgAdmin 3 are very different things. The Redmine ticket seems
> to be asking for the Service field (the pg_service.conf service name),
> *not* Service ID (the operating system's service ID, used to start/stop 
> the
> database server service).
>
> --
> 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


Re: [pgAdmin4][Patch]: RM #2963 - Backup database, Restore database and Maintenance Database failed for é object.

2018-03-12 Thread Khushboo Vashi
On Tue, Mar 13, 2018 at 2:29 AM, Dave Page  wrote:

> So I was trying to test this, and every time I try to run a backup, I'm
> getting the following, with or without your patch:
>
> (sqlite3.ProgrammingError) You must not use 8-bit bytestrings unless you
> use a text_factory that can interpret 8-bit bytestrings (like text_factory
> = str). It is highly recommended that you instead just switch your
> application to Unicode strings. [SQL: u'INSERT INTO process (pid, user_id,
> command, "desc", arguments, logdir, start_time, end_time, exit_code,
> acknowledge) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters:
> (180312205250107339, 1, u'/Library/PostgreSQL/9.4/bin/pg_dump',
> 'ccopy_reg\n_reconstructor\np0\n(cpgadmin.tools.backup\
> nBackupMessage\np1\nc__builtin__\nobject\np2\nNtp3\nRp4\n(dp5\nS\'cmd\'\np6\nV
> --file "/Users/dpage/foo.dmp" --host "127.0.0.1" --port "5432" --username
> "postgres" --no-password --verbose --format=c --blobs
> "\xe9"\np7\nsS\'backup_type\'\np8\nI3\nsS\'database\'\np9\
> nV\xe9\np10\nsS\'bfile\'\np11\nS\'foo.dmp\'\np12\nsS\'sid\'\np13\nI1\nsb.',
> u'--file,/Users/dpage/foo.dmp,--host,127.0.0.1,--port,5432,-
> -username,postgres,--no-password,--verbose,--format=c,--blobs,\xe9',
> '/var/lib/pgadmin/sessions/process_logs/180312205250107339', None, None,
> None, None)]
>
> Any thoughts as to what's going on? I wasn't getting this on my other
> laptop, and I can't think what else we would have changed to cause this.
>
> Deleting all the records from the process table from SQLITE will solve
this problem.
There were few issues related to encoding-decoding in my old patches, you
may have applied those.

> On Mon, Mar 12, 2018 at 2:00 AM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>>
>> Hi Dave,
>>
>> On Fri, Mar 9, 2018 at 9:09 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Fri, Mar 9, 2018 at 3:32 PM, Dave Page  wrote:
>>>
 Hi

 On Fri, Mar 9, 2018 at 3:54 AM, Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch to fix below issues:
>
> 1. #2963 - Backup database, Restore database and Maintenance Database
> failed for é object
> 2. #3157 - Process viewer doesn't show complete command executed.
>
> Test cases are not included for these fixes as we don't have test
> cases for these modules (backup, restore, maintenance).
> I will create one separate RM for the same which will cover this.
>

 Interesting that you fix these together, as together they also exhibit
 another bug :-). Backing up the é database displays the following
 command:

 /usr/local/pgsql/bin/pg_dump --file "/Users/dpage/foo.bak" --host
 "localhost" --port "5432" --username "postgres" --no-password --verbose
 --format=c --blobs "é"

>>>
>>> I can reproduce this issue only with notification dialogue (which I have
>> fixed in the attached patch) not with the details dialogue. Please refer
>> the screenshots for the same.
>>
>>> Also, what tests can we add for backup/restore? We have nothing at all
>>> at the moment, and it is pretty troublesome. I'd like to ensure that we can
>>> backup and restore a database correctly, and ensure that the displayed
>>> commands are what we expect and that we get valid output from
>>> pg_dump/pg_restore (though, it may change from PG version to PG version, so
>>> maybe we should just check for something small and generic). I guess this
>>> might need some config parameters for the tests to specify the pg_* utility
>>> paths for each server.
>>>
>>> I'd suggest maybe having a feature test that opens the prefs, sets the
>>> appropriate path, then runs a backup, waits for it to finish, checks the
>>> process monitor output, then restores the same backup to a new database,
>>> checking the process monitor output again, and then checking that the
>>> restored database contains at least one object from the original database
>>> (we don't need to check all of pg_dump/pg_restore, just that something
>>> expected was restored). We should use a (partial) database name and backup
>>> filename from the advanced test config file, and I think both should
>>> default to some interesting non-ASCII strings to ensure quoting works.
>>>
>> I was thinking of writing the unit test cases for the processes.py file
>> as all the major functionalities for backup/restore/maintenance jobs done
>> by this file, but by this we can not achieve the front-end string
>> validation esp for non-ASCII strings.
>> So, I am thinking of writing feature tests (as you have suggested) first
>> and after that if needed I will write unit test cases.
>>
>>>
>>> --
>>> 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 En

Re: [pgAdmin4][RM#3140] Add service parameter

2018-03-12 Thread Ashesh Vashi
Murtuza/Dave,

I have to reviewed/seen the patch yet.
But - I have a question.
Have we used the service file in the external tools for backup, restore,
and import/export functionalities?
If not - we should fix that asap.

We had missed that during SSL support, and now - we're fixing that.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


On Tue, Mar 13, 2018 at 6:18 AM, Dave Page  wrote:

> Hi
>
> On Mon, Mar 12, 2018 at 5:18 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Dave and Murtuza,
>>
>> Regarding this patch we refactored the Javascript code so that is lives
>> in a different file and added some tests.
>>
>> Also we found an issue with karma-jasmine that does not allow us to use
>> jasmine 3.1 yet. You can find attached a patch that reverts that commit.
>>
>
> Sounds good, but neither patch will apply (in fact, the Jasmine one looks
> entirely backwards). One of the error messages was changed in Murtuza's
> patch, and wasn't reflected in your update for example.
>
> Can you rebase please?
>
> Thanks.
>
>
>>
>> Thanks
>> Victoria && Joao
>>
>> On Mon, Mar 12, 2018 at 4:46 PM Dave Page  wrote:
>>
>>> Thanks, patch applied!
>>>
>>> On Mon, Mar 12, 2018 at 3:31 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Dave,

 PFA updated patch.

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


 On Fri, Mar 9, 2018 at 9:29 PM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> I'll change the name and send you updated patch.
>
>
> On Fri, Mar 9, 2018 at 9:25 PM, Dave Page  wrote:
>
>> HI
>>
>> On Fri, Mar 9, 2018 at 11:47 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch to add service parameter in server dialog.
>>> - Docs updated
>>> - Test case added for Service ID parameter
>>>
>>> Please note,
>>> I have extracted Connection class and Server manager class from our
>>> own custom Psycopg2 driver module.
>>>
>>> Patch also covers RM#3120
>>>
>>
>>  This patch seems a little confused. The "Service" and "Service ID"
>> fields from pgAdmin 3 are very different things. The Redmine ticket seems
>> to be asking for the Service field (the pg_service.conf service name),
>> *not* Service ID (the operating system's service ID, used to start/stop 
>> the
>> database server service).
>>
>> --
>> 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
>


Re: [pgAdmin4][Patch]: RM #2963 - Backup database, Restore database and Maintenance Database failed for é object.

2018-03-12 Thread Dave Page


> On 12 Mar 2018, at 23:12, Khushboo Vashi  
> wrote:
> 
> 
> 
>> On Tue, Mar 13, 2018 at 2:29 AM, Dave Page  wrote:
>> So I was trying to test this, and every time I try to run a backup, I'm 
>> getting the following, with or without your patch:
>> 
>> (sqlite3.ProgrammingError) You must not use 8-bit bytestrings unless you use 
>> a text_factory that can interpret 8-bit bytestrings (like text_factory = 
>> str). It is highly recommended that you instead just switch your application 
>> to Unicode strings. [SQL: u'INSERT INTO process (pid, user_id, command, 
>> "desc", arguments, logdir, start_time, end_time, exit_code, acknowledge) 
>> VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: (180312205250107339, 1, 
>> u'/Library/PostgreSQL/9.4/bin/pg_dump', 
>> 'ccopy_reg\n_reconstructor\np0\n(cpgadmin.tools.backup\nBackupMessage\np1\nc__builtin__\nobject\np2\nNtp3\nRp4\n(dp5\nS\'cmd\'\np6\nV
>>  --file "/Users/dpage/foo.dmp" --host "127.0.0.1" --port "5432" --username 
>> "postgres" --no-password --verbose --format=c --blobs 
>> "\xe9"\np7\nsS\'backup_type\'\np8\nI3\nsS\'database\'\np9\nV\xe9\np10\nsS\'bfile\'\np11\nS\'foo.dmp\'\np12\nsS\'sid\'\np13\nI1\nsb.',
>>  
>> u'--file,/Users/dpage/foo.dmp,--host,127.0.0.1,--port,5432,--username,postgres,--no-password,--verbose,--format=c,--blobs,\xe9',
>>  '/var/lib/pgadmin/sessions/process_logs/180312205250107339', None, None, 
>> None, None)]
>> 
>> Any thoughts as to what's going on? I wasn't getting this on my other 
>> laptop, and I can't think what else we would have changed to cause this.
>> 
> Deleting all the records from the process table from SQLITE will solve this 
> problem.
> There were few issues related to encoding-decoding in my old patches, you may 
> have applied those.

I deleted the database entirely, and still saw the problem.

>>> On Mon, Mar 12, 2018 at 2:00 AM, Khushboo Vashi 
>>>  wrote:
>>> 
>>> Hi Dave,
>>> 
 On Fri, Mar 9, 2018 at 9:09 PM, Dave Page  wrote:
 Hi
 
> On Fri, Mar 9, 2018 at 3:32 PM, Dave Page  wrote:
> Hi
> 
>> On Fri, Mar 9, 2018 at 3:54 AM, Khushboo Vashi 
>>  wrote:
>> Hi,
>> 
>> Please find the attached patch to fix below issues:
>> 
>> 1. #2963 - Backup database, Restore database and Maintenance Database 
>> failed for é object
>> 2. #3157 - Process viewer doesn't show complete command executed.
>> 
>> Test cases are not included for these fixes as we don't have test cases 
>> for these modules (backup, restore, maintenance).
>> I will create one separate RM for the same which will cover this.
> 
> Interesting that you fix these together, as together they also exhibit 
> another bug :-). Backing up the é database displays the following command:
> 
> /usr/local/pgsql/bin/pg_dump --file "/Users/dpage/foo.bak" --host 
> "localhost" --port "5432" --username "postgres" --no-password --verbose 
> --format=c --blobs "é" 
 
>>> 
>>> I can reproduce this issue only with notification dialogue (which I have 
>>> fixed in the attached patch) not with the details dialogue. Please refer 
>>> the screenshots for the same.
 Also, what tests can we add for backup/restore? We have nothing at all at 
 the moment, and it is pretty troublesome. I'd like to ensure that we can 
 backup and restore a database correctly, and ensure that the displayed 
 commands are what we expect and that we get valid output from 
 pg_dump/pg_restore (though, it may change from PG version to PG version, 
 so maybe we should just check for something small and generic). I guess 
 this might need some config parameters for the tests to specify the pg_* 
 utility paths for each server. 
 
 I'd suggest maybe having a feature test that opens the prefs, sets the 
 appropriate path, then runs a backup, waits for it to finish, checks the 
 process monitor output, then restores the same backup to a new database, 
 checking the process monitor output again, and then checking that the 
 restored database contains at least one object from the original database 
 (we don't need to check all of pg_dump/pg_restore, just that something 
 expected was restored). We should use a (partial) database name and backup 
 filename from the advanced test config file, and I think both should 
 default to some interesting non-ASCII strings to ensure quoting works.
>>> 
>>> I was thinking of writing the unit test cases for the processes.py file as 
>>> all the major functionalities for backup/restore/maintenance jobs done by 
>>> this file, but by this we can not achieve the front-end string validation 
>>> esp for non-ASCII strings.
>>> So, I am thinking of writing feature tests (as you have suggested) first 
>>> and after that if needed I will write unit test cases.
 
 -- 
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake
 
 EnterpriseDB UK: http://www.enterprisedb

Re: [pgAdmin4][RM#3140] Add service parameter

2018-03-12 Thread Murtuza Zabuawala
Hi Ashesh,

I haven't implemented that intentionally because Khushboo is working on the
same for SSL and our code will conflict, So once Khushboo's patch gets
committed, I'll make changes for Service file as well.


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


On Tue, Mar 13, 2018 at 9:01 AM, Ashesh Vashi  wrote:

> Murtuza/Dave,
>
> I have to reviewed/seen the patch yet.
> But - I have a question.
> Have we used the service file in the external tools for backup, restore,
> and import/export functionalities?
> If not - we should fix that asap.
>
> We had missed that during SSL support, and now - we're fixing that.
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
> On Tue, Mar 13, 2018 at 6:18 AM, Dave Page  wrote:
>
>> Hi
>>
>> On Mon, Mar 12, 2018 at 5:18 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hi Dave and Murtuza,
>>>
>>> Regarding this patch we refactored the Javascript code so that is lives
>>> in a different file and added some tests.
>>>
>>> Also we found an issue with karma-jasmine that does not allow us to use
>>> jasmine 3.1 yet. You can find attached a patch that reverts that commit.
>>>
>>
>> Sounds good, but neither patch will apply (in fact, the Jasmine one looks
>> entirely backwards). One of the error messages was changed in Murtuza's
>> patch, and wasn't reflected in your update for example.
>>
>> Can you rebase please?
>>
>> Thanks.
>>
>>
>>>
>>> Thanks
>>> Victoria && Joao
>>>
>>> On Mon, Mar 12, 2018 at 4:46 PM Dave Page  wrote:
>>>
 Thanks, patch applied!

 On Mon, Mar 12, 2018 at 3:31 AM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> PFA updated patch.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Fri, Mar 9, 2018 at 9:29 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> I'll change the name and send you updated patch.
>>
>>
>> On Fri, Mar 9, 2018 at 9:25 PM, Dave Page  wrote:
>>
>>> HI
>>>
>>> On Fri, Mar 9, 2018 at 11:47 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi,

 PFA patch to add service parameter in server dialog.
 - Docs updated
 - Test case added for Service ID parameter

 Please note,
 I have extracted Connection class and Server manager class from our
 own custom Psycopg2 driver module.

 Patch also covers RM#3120

>>>
>>>  This patch seems a little confused. The "Service" and "Service ID"
>>> fields from pgAdmin 3 are very different things. The Redmine ticket 
>>> seems
>>> to be asking for the Service field (the pg_service.conf service name),
>>> *not* Service ID (the operating system's service ID, used to start/stop 
>>> the
>>> database server service).
>>>
>>> --
>>> 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
>>
>
>


Re: [pgAdmin4][RM#3140] Add service parameter

2018-03-12 Thread Ashesh Vashi
On Tue, Mar 13, 2018 at 9:42 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Ashesh,
>
> I haven't implemented that intentionally because Khushboo is working on
> the same for SSL and our code will conflict, So once Khushboo's patch gets
> committed, I'll make changes for Service file as well.
>
No - that's a bad practice.
You need to work on full feature set, not partial.

If you have intentionally skipped that, you should have informed the list.

-- Thanks, Ashesh

>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Tue, Mar 13, 2018 at 9:01 AM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Murtuza/Dave,
>>
>> I have to reviewed/seen the patch yet.
>> But - I have a question.
>> Have we used the service file in the external tools for backup, restore,
>> and import/export functionalities?
>> If not - we should fix that asap.
>>
>> We had missed that during SSL support, and now - we're fixing that.
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> 
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> 
>>
>> On Tue, Mar 13, 2018 at 6:18 AM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Mon, Mar 12, 2018 at 5:18 PM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hi Dave and Murtuza,

 Regarding this patch we refactored the Javascript code so that is lives
 in a different file and added some tests.

 Also we found an issue with karma-jasmine that does not allow us to use
 jasmine 3.1 yet. You can find attached a patch that reverts that commit.

>>>
>>> Sounds good, but neither patch will apply (in fact, the Jasmine one
>>> looks entirely backwards). One of the error messages was changed in
>>> Murtuza's patch, and wasn't reflected in your update for example.
>>>
>>> Can you rebase please?
>>>
>>> Thanks.
>>>
>>>

 Thanks
 Victoria && Joao

 On Mon, Mar 12, 2018 at 4:46 PM Dave Page  wrote:

> Thanks, patch applied!
>
> On Mon, Mar 12, 2018 at 3:31 AM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> PFA updated patch.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Fri, Mar 9, 2018 at 9:29 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> I'll change the name and send you updated patch.
>>>
>>>
>>> On Fri, Mar 9, 2018 at 9:25 PM, Dave Page  wrote:
>>>
 HI

 On Fri, Mar 9, 2018 at 11:47 AM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to add service parameter in server dialog.
> - Docs updated
> - Test case added for Service ID parameter
>
> Please note,
> I have extracted Connection class and Server manager class from
> our own custom Psycopg2 driver module.
>
> Patch also covers RM#3120
>

  This patch seems a little confused. The "Service" and "Service ID"
 fields from pgAdmin 3 are very different things. The Redmine ticket 
 seems
 to be asking for the Service field (the pg_service.conf service name),
 *not* Service ID (the operating system's service ID, used to 
 start/stop the
 database server service).

 --
 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
>>>
>>
>>
>


Re: [pgAdmin4][RM#3139] Create proper template path if Windows

2018-03-12 Thread Murtuza Zabuawala
Hi Dave,

We are not joining template path with os.path.join because we are passing
prefix paths in render_template(..) at many places,
we are passing them as below,

Some of examples,

render_template(
"exclusion_constraint/js/exclusion_constraint.js",
_=_
),

recovery_check_sql = render_template(
"connect/sql/#{0}#/check_recovery.sql".format(postgres_version))

sql = render_template(
"/servers/sql/#{0}#/stats.sql".format(manager.version),
conn=conn, _=gettext
)

sql = render_template(
"/".join([self.template_path, 'create.sql']),
data=data, conn=self.conn
)

def csssnippets(self):
"""
Returns a snippet of css to include in the page
"""
snippets = [render_template("css/servers.css")]


So again it will conflict if use os.path.join, To make it consistent with
render_template(...) and VersionedTemplateLoader(..) class we opt'd for
this mechanism.


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


On Tue, Mar 13, 2018 at 6:11 AM, Dave Page  wrote:

> Hi
>
> On Mon, Mar 12, 2018 at 10:15 AM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch to correct the template path generation logic incase of Windows
>> system.
>>
>
> Seems like it would be better to fix it the other way round to me - e.g.
> update the template loader to use os.path.join.
>
> Any reason not to do that?
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgAdmin4][RM#3140] Add service parameter

2018-03-12 Thread Murtuza Zabuawala
On Tue, Mar 13, 2018 at 9:45 AM, Ashesh Vashi  wrote:

>
> On Tue, Mar 13, 2018 at 9:42 AM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Ashesh,
>>
>> I haven't implemented that intentionally because Khushboo is working on
>> the same for SSL and our code will conflict, So once Khushboo's patch gets
>> committed, I'll make changes for Service file as well.
>>
> No - that's a bad practice.
> You need to work on full feature set, not partial.
>
> If you have intentionally skipped that, you should have informed the list.
>

​I forgot to create sub-task, will keep that in mind next time onwards.​
https://redmine.postgresql.org/issues/3195


>
> -- Thanks, Ashesh
>
>>
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Tue, Mar 13, 2018 at 9:01 AM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> Murtuza/Dave,
>>>
>>> I have to reviewed/seen the patch yet.
>>> But - I have a question.
>>> Have we used the service file in the external tools for backup, restore,
>>> and import/export functionalities?
>>> If not - we should fix that asap.
>>>
>>> We had missed that during SSL support, and now - we're fixing that.
>>>
>>> --
>>>
>>> Thanks & Regards,
>>>
>>> Ashesh Vashi
>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>> 
>>>
>>>
>>> *http://www.linkedin.com/in/asheshvashi*
>>> 
>>>
>>> On Tue, Mar 13, 2018 at 6:18 AM, Dave Page  wrote:
>>>
 Hi

 On Mon, Mar 12, 2018 at 5:18 PM, Joao De Almeida Pereira <
 jdealmeidapere...@pivotal.io> wrote:

> Hi Dave and Murtuza,
>
> Regarding this patch we refactored the Javascript code so that is
> lives in a different file and added some tests.
>
> Also we found an issue with karma-jasmine that does not allow us to
> use jasmine 3.1 yet. You can find attached a patch that reverts that 
> commit.
>

 Sounds good, but neither patch will apply (in fact, the Jasmine one
 looks entirely backwards). One of the error messages was changed in
 Murtuza's patch, and wasn't reflected in your update for example.

 Can you rebase please?

 Thanks.


>
> Thanks
> Victoria && Joao
>
> On Mon, Mar 12, 2018 at 4:46 PM Dave Page  wrote:
>
>> Thanks, patch applied!
>>
>> On Mon, Mar 12, 2018 at 3:31 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> PFA updated patch.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>>> On Fri, Mar 9, 2018 at 9:29 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Dave,

 I'll change the name and send you updated patch.


 On Fri, Mar 9, 2018 at 9:25 PM, Dave Page 
 wrote:

> HI
>
> On Fri, Mar 9, 2018 at 11:47 AM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch to add service parameter in server dialog.
>> - Docs updated
>> - Test case added for Service ID parameter
>>
>> Please note,
>> I have extracted Connection class and Server manager class from
>> our own custom Psycopg2 driver module.
>>
>> Patch also covers RM#3120
>>
>
>  This patch seems a little confused. The "Service" and "Service
> ID" fields from pgAdmin 3 are very different things. The Redmine 
> ticket
> seems to be asking for the Service field (the pg_service.conf service
> name), *not* Service ID (the operating system's service ID, used to
> start/stop the database server service).
>
> --
> 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

>>>
>>>
>>
>


Re: [pgAdmin4][Patch]: RM #2963 - Backup database, Restore database and Maintenance Database failed for é object.

2018-03-12 Thread Khushboo Vashi
On Tue, Mar 13, 2018 at 9:39 AM, Dave Page  wrote:

>
>
> On 12 Mar 2018, at 23:12, Khushboo Vashi 
> wrote:
>
>
>
> On Tue, Mar 13, 2018 at 2:29 AM, Dave Page  wrote:
>
>> So I was trying to test this, and every time I try to run a backup, I'm
>> getting the following, with or without your patch:
>>
>> (sqlite3.ProgrammingError) You must not use 8-bit bytestrings unless you
>> use a text_factory that can interpret 8-bit bytestrings (like text_factory
>> = str). It is highly recommended that you instead just switch your
>> application to Unicode strings. [SQL: u'INSERT INTO process (pid, user_id,
>> command, "desc", arguments, logdir, start_time, end_time, exit_code,
>> acknowledge) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters:
>> (180312205250107339, 1, u'/Library/PostgreSQL/9.4/bin/pg_dump',
>> 'ccopy_reg\n_reconstructor\np0\n(cpgadmin.tools.backup\nBack
>> upMessage\np1\nc__builtin__\nobject\np2\nNtp3\nRp4\n(dp5\nS\'cmd\'\np6\nV
>> --file "/Users/dpage/foo.dmp" --host "127.0.0.1" --port "5432" --username
>> "postgres" --no-password --verbose --format=c --blobs
>> "\xe9"\np7\nsS\'backup_type\'\np8\nI3\nsS\'database\'\np9\nV
>> \xe9\np10\nsS\'bfile\'\np11\nS\'foo.dmp\'\np12\nsS\'sid\'\np13\nI1\nsb.',
>> u'--file,/Users/dpage/foo.dmp,--host,127.0.0.1,--port,5432,-
>> -username,postgres,--no-password,--verbose,--format=c,--blobs,\xe9',
>> '/var/lib/pgadmin/sessions/process_logs/180312205250107339', None, None,
>> None, None)]
>>
>> Any thoughts as to what's going on? I wasn't getting this on my other
>> laptop, and I can't think what else we would have changed to cause this.
>>
>> Deleting all the records from the process table from SQLITE will solve
> this problem.
> There were few issues related to encoding-decoding in my old patches, you
> may have applied those.
>
>
> I deleted the database entirely, and still saw the problem.
>
> I have tried many things to reproduce this but couldn't.  I faced this
issue when I was fixing the issue but not now.
Please make sure to delete the old session and a process table (or
database) and apply my latest patch. (of course you do this :) )
I have PY - 2.7.12, psycopg2 - 2.7.4 and SQLAlhemy -1.0.14 to be more
specific.

> On Mon, Mar 12, 2018 at 2:00 AM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>>
>>> Hi Dave,
>>>
>>> On Fri, Mar 9, 2018 at 9:09 PM, Dave Page  wrote:
>>>
 Hi

 On Fri, Mar 9, 2018 at 3:32 PM, Dave Page  wrote:

> Hi
>
> On Fri, Mar 9, 2018 at 3:54 AM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached patch to fix below issues:
>>
>> 1. #2963 - Backup database, Restore database and Maintenance Database
>> failed for é object
>> 2. #3157 - Process viewer doesn't show complete command executed.
>>
>> Test cases are not included for these fixes as we don't have test
>> cases for these modules (backup, restore, maintenance).
>> I will create one separate RM for the same which will cover this.
>>
>
> Interesting that you fix these together, as together they also exhibit
> another bug :-). Backing up the é database displays the following
> command:
>
> /usr/local/pgsql/bin/pg_dump --file "/Users/dpage/foo.bak" --host
> "localhost" --port "5432" --username "postgres" --no-password --verbose
> --format=c --blobs "é"
>

 I can reproduce this issue only with notification dialogue (which I
>>> have fixed in the attached patch) not with the details dialogue. Please
>>> refer the screenshots for the same.
>>>
 Also, what tests can we add for backup/restore? We have nothing at all
 at the moment, and it is pretty troublesome. I'd like to ensure that we can
 backup and restore a database correctly, and ensure that the displayed
 commands are what we expect and that we get valid output from
 pg_dump/pg_restore (though, it may change from PG version to PG version, so
 maybe we should just check for something small and generic). I guess this
 might need some config parameters for the tests to specify the pg_* utility
 paths for each server.

 I'd suggest maybe having a feature test that opens the prefs, sets the
 appropriate path, then runs a backup, waits for it to finish, checks the
 process monitor output, then restores the same backup to a new database,
 checking the process monitor output again, and then checking that the
 restored database contains at least one object from the original database
 (we don't need to check all of pg_dump/pg_restore, just that something
 expected was restored). We should use a (partial) database name and backup
 filename from the advanced test config file, and I think both should
 default to some interesting non-ASCII strings to ensure quoting works.

>>> I was thinking of writing the unit test cases for the processes.py file
>>> as all the major functionalit