Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2XKv-0004g6-KF for pgadmin-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 10:37:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2XKu-0007iP-GG for pgadmin-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 10:37:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2XKu-0007iH-9X for pgadmin-hackers@lists.postgresql.org; Thu, 21 Jan 2021 10:37:08 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l2XKs-0003UR-9m for pgadmin-hackers@postgresql.org; Thu, 21 Jan 2021 10:37:07 +0000 Received: by mail-ej1-x636.google.com with SMTP id g3so1889036ejb.6 for ; Thu, 21 Jan 2021 02:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ve0IpjZDwDoruygNMIm4Hd9NOChzSxppZtfsaUrk3Mw=; b=boeS/F5cYhNRgcO5vF6UZxaAngWuTUtZJW4D9w5vT+e3jviYlCqFlbIAPrq/Il37nn J3Fm4vnNPq209Yk4sTnz9xNJUwVSKa/9du2eLawlxJIQ4d3bsg97dcK7bGZellWv/tfH 2dCHPvQxZhvImd2O9mJ5/GZ/mC/xmLsM0ofyvRw6m3ciuwIfhsg5YZly3msw8Ub8rtYM Y3p4kGzbxS43a910TQA8ZdllBnNb/8iP3KNQBN1Xtm2rPT2M2RcYxQeVpePREqwEA4eD d9kpetLpbfyX0eEsRYpk3jUVtKCj5YuhbSVRW2k1WkZAHwKRJ3QhHzswO7JIEGbhSNVy nMmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ve0IpjZDwDoruygNMIm4Hd9NOChzSxppZtfsaUrk3Mw=; b=UWLGUsx3wJVyZowzlthUroIXUZgvwvSR7HIH1I8JyHb1Xy+ove4oGXIfVHECoYSrsh 1DjhIOD19XEfZQll6ZPnxWAGVmcmRRQQFB+uPLPWCvuH1n7N1CxDkhf5vKZ2ChP3OWI+ a5sV7knt/yTgjKJnlTuHx+7HpDzY/S9l4NEyZRZd5KxqiqE3rzqwAh4VULrOGZluSbK5 a4FBW6QvccevCGp4kE/d8nWFoMxaDrF7QcxoTFKzLaZwGu/r8Unt46jxYrxnRabk+7NP ns7xhc6k3/qL/uStnhI/7aRZe+jgugCH00dIhfBtMHv0lQGFThHvAnUNUwhINPJGnwWh fgLw== X-Gm-Message-State: AOAM532C19/H8DuiZLl/DHxUZ4gwO+Nw9J0qaaBzrWqa/HBnMU7JaLG2 uin0ldVJJociQ/d2+m9t+aXVPCQt51YFZSrf3hd3KA== X-Google-Smtp-Source: ABdhPJwvoZm633DDpdbtY3+UtldBENbhHX/NTIc1KTJLmvQdqA5pMM9V3/xEigC4FxVUzcVoyskCpdytC/eMOJ8+PY0= X-Received: by 2002:a17:906:158c:: with SMTP id k12mr9009638ejd.119.1611225425424; Thu, 21 Jan 2021 02:37:05 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Thu, 21 Jan 2021 10:36:54 +0000 Message-ID: Subject: Re: [pgAdmin][RM-6143]: Shared server entries not getting deleted. To: Nikhil Mohite Cc: Akshay Joshi , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000022c8c905b966a76c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000022c8c905b966a76c Content-Type: text/plain; charset="UTF-8" Hi On Thu, Jan 21, 2021 at 10:33 AM Nikhil Mohite < nikhil.mohite@enterprisedb.com> wrote: > Hi Dave, > > On Thu, Jan 21, 2021 at 3:24 PM Akshay Joshi < > akshay.joshi@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.joshi@enterprisedb.com> wrote: >>> >>>> Thanks, patch applied. >>>> >>>> On Thu, Jan 21, 2021 at 12:18 PM Nikhil Mohite < >>>> nikhil.mohite@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 --00000000000022c8c905b966a76c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, Jan 21, 2021 at 10:33 AM Nikhil= Mohite <nikhil.mohite= @enterprisedb.com> wrote:
Hi Dave,

On Thu, Jan = 21, 2021 at 3:24 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
= Reverted the commit.

On Thu, Jan 21, 2021 at 3:13 PM Dave Page <dpage@pgadmin.org> w= rote:
This seems like a very bad idea. What if the user that has left wa= s the user that setup 50 connections used by everyone else?

<= div>Deleting those shared entries is (I would guess) most likely=C2=A0*not*= what the majority of users would want, and the current behaviour is defini= tely 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 c= reated any Shared server other users are not able to access it as it= s server group is not present in the database.

That seems bad. I would suggest we only delete the gr= oup if there are no shared servers left in it that would become orphaned. O= f course, in that case we'll also need to reassign ownership of the gro= up.
=C2=A0

We should make t= his optional; i.e. ask the use if they want shared servers created by the u= ser to be deleted. If they say no, they should be reassigned to another use= r; 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 entri= es per user, for deletion of non-admin user we can delete the shared server= tables entries as it will not affect=C2=A0any other users. (because only a= dmin users can mark the server as shared.)=C2=A0
In case of admin= user deletion, will add an extra check as suggested.

Sounds good - thanks!
=C2=A0
=C2=A0

Please revert this, until the deletion is made optional.=C2= =A0

On Thu, Jan 21, 2021 at 9:23 AM Akshay Joshi <akshay.joshi@enterprisedb= .com> wrote:
Thanks, patch applied.

On Thu, Jan 21, 2021 at 12:18 PM= Nikhil Mohite <nikhil.mohite@enterprisedb.com> wrote:
Hi Team,
Please find the attached patch for RM-6143:=C2=A0Shared serve= r 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.
Mob.No: +91-7798364578.


--
Thank= s & Regards
Akshay Joshi
pgAdmin Hacker | Principal Softw= are Architect
EDB Po= stgres
Mobile: +91 976-788-8246



--


--
Thank= s & Regards
Akshay Joshi
pgAdmin Hacker | Principal Softw= are Architect
EDB Po= stgres
Mobile: +91 976-788-8246

Regards,
N= ikhil Mohite.=C2=A0


--
--00000000000022c8c905b966a76c--