[pgAdmin][RM6193] Should warn before closing if opened in a new tab

2021-02-01 Thread Aditya Toshniwal
Hi Hackers,

ERD will now throw warning before closing unsaved changes if opened in a
new tab.
Please review.

-- 
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*

"Don't Complain about Heat, Plant a TREE"


RM6193.patch
Description: Binary data


Re: [pgAdmin][RM-6143]: Shared server entries not getting deleted.

2021-02-01 Thread Dave Page
Hi

On Mon, Feb 1, 2021 at 7:51 AM Nikhil Mohite 
wrote:

> Hi Dave/ Team,
>
> As per the suggestions I have created a sample UI for change ownership of
> shared servers before deleting the user(only for admin user).
> [image: shared_server_change_ownsership.png]
> The user list will contain all admin users. (This alert will get display
> if the admin user has created any shared servers.)
>

The UI is fine, but the wording needs work. A couple of general hints: An
entire sense would never be in parentheses, and there should always be a
space following a full stop.

"Select the user that will take ownership of the shared servers created by
.  shared servers are currently owned by this user."

"Note: If no user is selected, the shared servers will be deleted."

I'd also suggest that if the user does not select a new owner, a message
box should ask for confirmation before continuing:

"The shared servers owned by  will be deleted. Do you wish to
continue?".


>
> Any suggestions or if I missed anything please let me know.
>
> Regards,
> Nikhil Mohite
>
> On Thu, Jan 21, 2021 at 4:07 PM Dave Page  wrote:
>
>> Hi
>>
>> On Thu, Jan 21, 2021 at 10:33 AM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Thu, Jan 21, 2021 at 3:24 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Reverted the commit.

 On Thu, Jan 21, 2021 at 3:13 PM Dave Page  wrote:

> This seems like a very bad idea. What if the user that has left was
> the user that setup 50 connections used by everyone else?
>
> Deleting those shared entries is (I would guess) most likely *not*
> what the majority of users would want, and the current behaviour is
> definitely safest.
>
 In the current implementation when the admin user gets deleted all "*Server
>>> groups*" created by that user are getting deleted, so if that admin has
>>> created any *Shared server* other users are not able to access it as
>>> its server group is not present in the database.
>>>
>>
>> That seems bad. I would suggest we only delete the group if there are no
>> shared servers left in it that would become orphaned. Of course, in that
>> case we'll also need to reassign ownership of the group.
>>
>>
>>>
> We should make this optional; i.e. ask the use if they want shared
> servers created by the user to be deleted. If they say no, they should be
> reassigned to another user; either the admin that's deleting the user, or
> their choice of user (a little more complex of course, but more flexible).
>
 In the shared server table, we are creating entries per user, for
>>> deletion of non-admin user we can delete the shared server tables entries
>>> as it will not affect any other users. (because only admin users can mark
>>> the server as shared.)
>>> In case of admin user deletion, will add an extra check as suggested.
>>>
>>
>> Sounds good - thanks!
>>
>>
>>>
>

> Please revert this, until the deletion is made optional.
>
> On Thu, Jan 21, 2021 at 9:23 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, patch applied.
>>
>> On Thu, Jan 21, 2021 at 12:18 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>>
>>> Please find the attached patch for RM-6143
>>> : Shared server entries
>>> not getting deleted.
>>> Added code to delete shared server entries if the admin deletes the
>>> user from user management.
>>>
>>>
>>> --
>>> *Thanks & Regards,*
>>> *Nikhil Mohite*
>>> *Software Engineer.*
>>> *EDB Postgres* 
>>> *Mob.No: +91-7798364578.*
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EDB: http://www.enterprisedb.com
>
>

 --
 *Thanks & Regards*
 *Akshay Joshi*
 *pgAdmin Hacker | Principal Software Architect*
 *EDB Postgres *

 *Mobile: +91 976-788-8246*

>>>
>>> Regards,
>>> Nikhil Mohite.
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EDB: http://www.enterprisedb.com
>>
>>

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

EDB: http://www.enterprisedb.com


pgAdmin 4 commit: Added support for Logical Replication. Fixes #5912

2021-02-01 Thread Akshay Joshi
Added support for Logical Replication. Fixes #5912

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=bf56a6723b1acf625dd35503cda207a34d55824b
Author: Pradip Parkale 

Modified Files
--
docs/en_US/release_notes_5_0.rst   |   3 +-
.../servers/databases/publications/__init__.py | 858 
.../publications/static/img/coll-publication.svg   |  22 +
.../publications/static/img/coll-subscription.svg  |  30 +
.../publications/static/img/publication.svg|  22 +
.../publications/static/img/subscription.svg   |  22 +
.../publications/static/js/publication.js  | 252 ++
.../templates/publications/sql/11_plus/create.sql  |  20 +
.../publications/sql/11_plus/properties.sql|   8 +
.../templates/publications/sql/default/create.sql  |  16 +
.../templates/publications/sql/default/delete.sql  |   8 +
.../publications/sql/default/get_all_tables.sql|   6 +
.../publications/sql/default/get_position.sql  |   1 +
.../publications/sql/default/get_tables.sql|   1 +
.../templates/publications/sql/default/nodes.sql   |   1 +
.../publications/sql/default/properties.sql|   8 +
.../templates/publications/sql/default/update.sql  |  42 +
.../tests/10_plus/alter_publication.sql|   7 +
.../tests/10_plus/alter_publication_event.sql  |   7 +
.../tests/10_plus/alter_publication_event_msql.sql |   2 +
.../tests/10_plus/alter_publication_msql.sql   |   1 +
.../tests/10_plus/create_publication.sql   |   7 +
.../tests/10_plus/create_publication_msql.sql  |   3 +
.../tests/10_plus/create_publication_update.sql|   7 +
.../10_plus/create_publication_update_msql.sql |   3 +
.../databases/publications/tests/10_plus/test.json |  79 ++
.../databases/publications/tests/__init__.py   |  16 +
.../publications/tests/publication_test_data.json  | 397 ++
.../publications/tests/test_publication_create.py  |  95 +++
.../publications/tests/test_publication_delete.py  |  94 +++
.../tests/test_publication_delete_multiple.py  | 103 +++
.../publications/tests/test_publication_get.py | 100 +++
.../publications/tests/test_publication_put.py | 127 +++
.../publications/tests/test_publication_sql.py |  88 +++
.../servers/databases/publications/tests/utils.py  | 152 
.../databases/schemas/tables/static/js/table.js|   5 +
.../templates/tables/sql/10_plus/properties.sql|   6 +
.../templates/tables/sql/11_plus/properties.sql|   6 +
.../tables/templates/tables/sql/11_plus/update.sql |  12 +
.../templates/tables/sql/12_plus/properties.sql|   6 +
.../tables/templates/tables/sql/12_plus/update.sql |  12 +
.../tables/templates/tables/sql/default/update.sql |  14 +
.../servers/databases/static/js/database.js|  12 +
.../servers/databases/subscriptions/__init__.py| 860 +
.../subscriptions/static/img/coll-publication.svg  |  22 +
.../subscriptions/static/img/coll-subscription.svg |  30 +
.../subscriptions/static/img/publication.svg   |  22 +
.../subscriptions/static/img/subscription.svg  |  22 +
.../subscriptions/static/js/subscription.js| 430 +++
.../templates/subscriptions/sql/default/create.sql |  24 +
.../templates/subscriptions/sql/default/delete.sql |   8 +
.../subscriptions/sql/default/get_position.sql |   1 +
.../templates/subscriptions/sql/default/nodes.sql  |   7 +
.../subscriptions/sql/default/properties.sql   |  21 +
.../templates/subscriptions/sql/default/stats.sql  |   8 +
.../templates/subscriptions/sql/default/update.sql |  65 ++
.../tests/10_plus/alter_maintenance_db.sql |   8 +
.../tests/10_plus/alter_subscription.sql   |   8 +
.../subscriptions/tests/10_plus/alter_sync.sql |   8 +
.../tests/10_plus/create_subscription.sql  |   8 +
.../tests/10_plus/create_subscription_msql.sql |   4 +
.../subscriptions/tests/10_plus/test.json  |  70 ++
.../databases/subscriptions/tests/__init__.py  |  16 +
.../tests/subscription_test_data.json  | 432 +++
.../tests/test_subscription_create.py  |  97 +++
.../tests/test_subscription_delete.py  |  93 +++
.../tests/test_subscription_delete_multiple.py | 106 +++
.../subscriptions/tests/test_subscription_get.py   |  99 +++
.../subscriptions/tests/test_subscription_put.py   | 112 +++
.../subscriptions/tests/test_subscription_sql.py   |  88 +++
.../servers/databases/subscriptions/tests/utils.py | 157 
.../templates/depends/pg/10_plus/dependents.sql|  79 ++
.../templates/depends/pg/11_plus/dependents.sql|   8 +-
.../templates/depends/pg/12_plus/dependents.sql|   8 +-
.../templates/depends/ppas/10_plus/dependents.sql  |  82 ++
.../templates/depends/ppas/11_plus/dependents.sql  |   9 +-
.../templates/depends/ppas/12_plus/dependents.sql  |   8 +-
web/pgadmin/browser/static/js/runtime.js   |   2 +-
web/pgadmin/browser/utils.py 

Re: [pgAdmin][RM5912]: Added support for Logical Replication.

2021-02-01 Thread Akshay Joshi
Thanks, the patch applied with some fixes.

On Wed, Jan 27, 2021 at 11:09 AM Pradip Parkale <
pradip.park...@enterprisedb.com> wrote:

> Hi Akshay,
> Please find the updated patch. I have fixed almost all issues, some are
> not possible.
>
> On Sat, Jan 16, 2021 at 4:29 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Pradip
>>
>> Following are the GUI related review comments:
>>
>> *Publication:*
>>
>>1. The truncate option is not visible for PG 10 but the SQL query
>>showing it.
>>
>> Fixed,
>
>>
>>1. "All table?" should be "All tables?" and "Table" should be renamed
>>to "Tables".
>>
>> Fixed.
>
>>
>>1. "-- Publication : test;
>>-- DROP PUBLICATION test;" Follow the syntax(Spacing, no space
>>between colon) as we did for other nodes. Check the SQL tab for any other
>>node.
>>
>> Fixed.
>
>>
>>1. Select any publication and open the properties dialog, Save button
>>is enabled by default which should not.
>>
>> Fixed.
>
>>
>>1. Create publication with (insert, update, delete, and truncate).
>>Open the properties dialog and Set the value of Insert, Update and Delete
>>to "No" check the SQL tab no ALTER query is there. ALTER query should be
>>there.
>>
>> Fixed.
>
>>
>>1. 'Only Table' is not visible in the Properties panel.
>>
>> There is no entry of 'Only Table?' in the pg_publication table, so it is
> not possible to get the value of this.
>
>>
>>1. On the collection node 'Publications' we should add Tables in the
>>properties panel.
>>
>> Fixed.
>
>>
>>1. Create a publication using one table and set 'Only Table' to No.
>>Select a newly created publication and set 'Only Table' to Yes, no SQL
>>query is generated.
>>
>> I have disabled this control. This control will be enabled only when the
> user has changed the table data.
>
>>
>>1. Adding a table in the publication should generate 'ALTER
>>PUBLICATION .. ADD TABLE ..' syntax instead of 'ALTER PUBLICATION .. SET
>>TABLE..'
>>
>> Fixed.
>
>>
>>1. Create a publication with more than one table. Remove one table
>>from publication it is creating two ALTER statements one for DROP Table 
>> and
>>another one is to SET TABLE which I think not required.
>>
>> Fixed.
>
>> *Subscription:*
>>
>>1. Reduce the width of the subscription dialog.
>>
>> Fixed. I reduced the width to '501px'
>
>>
>>1. *With *tab, alignment is not proper. Switch control should be
>>aligned with others.
>>
>> Fixed.
>
>>
>>1. Help messages required for every control in *With* tab.
>>
>> Fixed.
>
>>
>>1. Open Create subscription dialog, specify the name, on the
>>connection tab click the button to get the publication without specifying
>>any details. One popup comes with msg 'host'. I would suggest to
>>*disabled* that button until all the required fields will be
>>populated or entered by the user.
>>
>> Fixed.' Publication' control will only be enabled when the user
> entered the required connection details.
>
>>
>>1. Publication list from the same database server should be listed by
>>default.
>>
>> This won't be a good idea to display the default publication because if
> the user entered the connection details of some other server and select the
> default publication without clicking on the 'get_publication' button then
> it will be a wrong mapping between connection details and publication.
> Logical replication won't happen then.
>
>>
>>1. Specify all the required connection details on the connection tab
>>and click on the 'get publication' button. It fetches the publication but
>>no message for the user that action is successfully completed. For the
>>user, it seems nothing is happening and the user will click on that button
>>continuously. *Suggestion: *Show some message 'Publications fetched
>>successfully.' or something similar.
>>
>> Fixed. Added information message at the right bottom of the page.
>
>>
>>1. "-- Subscription : my_sub; -- DROP SUBSCRIPTION my_sub;" Follow
>>the syntax(Spacing, no space between colon) as we did for other nodes.
>>Check the SQL tab for any other node.
>>
>> Done.
>
>>
>>1. Remove the unnecessary spaces from the following SQL:
>>   - CONNECTION ' host=127.0.0.1  port=5436 user=postgres
>>   dbname=postgres '
>>   - with (enabled = False,  slot_name = my_sub1, synchronous_commit
>>   = 'off');
>>   - (connect = True, enabled = True, copy_data = True, create_slot =
>>   True, synchronous_commit = 'off');  Use small true/false instead of
>>   True/False.
>>
>> Fixed.
>
>>
>>1. Create a subscription. Open the properties dialog and click on the
>>"get publication" button. It throws an error message with the string
>>'password', please provide a valid error message. Check for all such error
>>messages.
>>
>> Fixed.
>
>>
>>1. Consider the above(Point 9) scenario and provide a password and
>>then click on th

pgAdmin 4 commit: Default to Python 3.9.1

2021-02-01 Thread Dave Page
Default to Python 3.9.1

Branch
--
master

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

Modified Files
--
pkg/mac/build.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Use the same retry logic we use on Linux for grabbing

2021-02-01 Thread Dave Page
Use the same retry logic we use on Linux for grabbing nwjs.

Branch
--
master

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

Modified Files
--
pkg/mac/build-functions.sh | 31 +++
1 file changed, 27 insertions(+), 4 deletions(-)



pgAdmin 4 commit: Make sure the doc builder has the dependencies it nee

2021-02-01 Thread Dave Page
Make sure the doc builder has the dependencies it needs.

Branch
--
master

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

Modified Files
--
Dockerfile | 18 +++---
1 file changed, 7 insertions(+), 11 deletions(-)



[pgAdmin4][Patch]: Dependency tab fix

2021-02-01 Thread Khushboo Vashi
Hi,

Please find the attached patch to fix the dependency tab loading issue with
the database name having special characters like (',"" etc...)

Thanks,
Khushboo


dependency_tab_fix.patch
Description: Binary data


pgAdmin 4 commit: Ensure the bundle identifier matches what's in Info.p

2021-02-01 Thread Dave Page
Ensure the bundle identifier matches what's in Info.plist.

Branch
--
master

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

Modified Files
--
pkg/mac/build-functions.sh | 12 
pkg/mac/codesign.conf.in   |  2 +-
2 files changed, 5 insertions(+), 9 deletions(-)



UBI based container patch

2021-02-01 Thread Dave Page
* Do not commit this! *

The dev team have discussed moving the pgAdmin container to be based on
Redhat's UBI instead of Alpine Linux. I got some time today to work on
that, and a patch is attached for interest/archives.

Whilst the build process is arguably cleaner with this patch, plus it
would be easier to maintain the versions of the PostgreSQL tools that are
included, unfortunately using UBI takes the size of the container from
~278MB to ~462MB.

So... unless someone finds a huge error in the patch that causes this
bloat, I think we have no choice but to stick with Alpine Linux.

Any thoughts/comments?

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

EDB: http://www.enterprisedb.com


ubi-container.diff
Description: Binary data


pgAdmin 4 commit: Remove some unnecessary files from the doc build to s

2021-02-01 Thread Dave Page
Remove some unnecessary files from the doc build to save space.

Branch
--
master

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

Modified Files
--
Dockerfile | 4 
1 file changed, 4 insertions(+)



pgAdmin 4 commit: Remove the PG 9.5 utilities, as it'll be out of suppo

2021-02-01 Thread Dave Page
Remove the PG 9.5 utilities, as it'll be out of support by the next release.

Branch
--
master

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

Modified Files
--
Dockerfile  | 5 -
docs/en_US/container_deployment.rst | 1 -
2 files changed, 6 deletions(-)



pgAdmin 4 commit: Make sure pgAdmin can find the root certificates for

2021-02-01 Thread Dave Page
Make sure pgAdmin can find the root certificates for upgrade checks.

Branch
--
master

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

Modified Files
--
pkg/docker/entrypoint.sh | 1 +
1 file changed, 1 insertion(+)



pgAdmin 4 commit: Rotate the logfile in the container distribution. Fix

2021-02-01 Thread Dave Page
Rotate the logfile in the container distribution. Fixes #6170

Branch
--
master

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

Modified Files
--
Dockerfile   | 4 +++-
docs/en_US/release_notes_5_0.rst | 1 +
pkg/docker/logrotate.conf| 6 ++
3 files changed, 10 insertions(+), 1 deletion(-)



pgAdmin 4 commit: Use the latest Gunicorn.

2021-02-01 Thread Dave Page
Use the latest Gunicorn.

Branch
--
master

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

Modified Files
--
Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgAdmin 4 commit: Fixed dependency tab loading issue when database name

2021-02-01 Thread Akshay Joshi
Fixed dependency tab loading issue when database name having special characters.

refs #6087

Branch
--
master

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

Modified Files
--
.../servers/templates/depends/gpdb/5_plus/role_dependencies.sql | 2 +-
.../servers/templates/depends/pg/9.1_plus/role_dependencies.sql | 2 +-
.../servers/templates/depends/ppas/9.1_plus/role_dependencies.sql   | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)



pgAdmin 4 commit: Ensure that ERD throws a warning before closing unsav

2021-02-01 Thread Akshay Joshi
Ensure that ERD throws a warning before closing unsaved changesĀ if open in a 
new tab. Fixes #6193

Branch
--
master

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

Modified Files
--
docs/en_US/release_notes_5_0.rst  |  1 +
web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js   | 11 ---
.../erd/static/js/erd_tool/ui_components/BodyWidget.jsx   | 15 +++
3 files changed, 24 insertions(+), 3 deletions(-)



Re: [pgAdmin4][Patch]: Dependency tab fix

2021-02-01 Thread Akshay Joshi
Thanks, patch applied.

On Mon, Feb 1, 2021 at 5:46 PM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch to fix the dependency tab loading issue
> with the database name having special characters like (',"" etc...)
>
> Thanks,
> Khushboo
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM6193] Should warn before closing if opened in a new tab

2021-02-01 Thread Akshay Joshi
Thanks, patch applied.

On Mon, Feb 1, 2021 at 2:13 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> ERD will now throw warning before closing unsaved changes if opened in a
> new tab.
> Please review.
>
> --
> Thanks,
> Aditya Toshniwal
> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
> 
> "Don't Complain about Heat, Plant a TREE"
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*