Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slPVV-007TxL-W4 for pgadmin-hackers@arkaria.postgresql.org; Tue, 03 Sep 2024 09:07:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1slPVV-009KGr-5l for pgadmin-hackers@arkaria.postgresql.org; Tue, 03 Sep 2024 09:07:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slPVU-009KGe-P7 for pgadmin-hackers@lists.postgresql.org; Tue, 03 Sep 2024 09:07:25 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1slPVR-000QLW-KE for pgadmin-hackers@postgresql.org; Tue, 03 Sep 2024 09:07:23 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3df0c4a65baso3008500b6e.2 for ; Tue, 03 Sep 2024 02:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1725354441; x=1725959241; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0NcFGYU/ah0elWG+s+/hR+oQkGbX48KkCgjdIq50QNE=; b=AmO6Y/ijhLugi4gB2bFhjzLir6UKgmBN2JtssLS060U4w4SowJoaB9FsI0BdmulDVH Y+qeAl4Fd3rVhs49DIhwBWvTcqNoLp+uT5VQ+EY2nuZeRXEBh0M7IrkovQ70oU3f1BCr L7AIWRcu3bstd4UMFp/iOJe3gcwOrY40vywFY3BO8V6gmuwJIjR+vVznZCJMnYacl8WM U9GQ1qjjvOAZf+ae7huiKuQdyuRUbH+iY/eDLeeyBb3AgAZhWzGXdGeK3dwxb6yxbA80 bFzZm8K+xSejt5dGfYP6bWoYrl9FphhpVeUmSoPw4ts6wjpOQakEfWRUYLeVFfnU+a4P 6YGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725354441; x=1725959241; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0NcFGYU/ah0elWG+s+/hR+oQkGbX48KkCgjdIq50QNE=; b=PJ2Z4n7dP5FGNAQbskFt8S/xaGR8segPFQ0s34KF4kUtu8Ez5fHOd0O62nsJ/O1Nnn ow8ZhayNAYPunlSQheibKt1aHNnisS+OrpkbQaWVSrnJ0aJd3+9cyIhk0cT7I58gJlR9 D5M+3rKngND09Wsuu6PV4ggXA9JU/AlvIym9YN0K7K+3cjsTIRExGWSMl2h6Wp2mkWak wsuTxmrBzufWnaSIZqBmYGbxaza0bAFQHqtKZM8gPdRelhrEspfkn8SLpWmCCrDhFRB2 KxHfwHcApp4RUXgmFKBBy9fX89kYxw7goUZJTH1fDnZOaNMq3a+prw8jgJemU8aA1vfp O3aQ== X-Forwarded-Encrypted: i=1; AJvYcCXmtUHQiB1RwR6KvGqekZSQRVCQKnKRy5tEIRX9KJw8yvpuOPdkg4LNZKEV3AVKK7KuZg62h6JwHSJgA1xo0Ko=@postgresql.org X-Gm-Message-State: AOJu0YwJXnPjZGGqxO4XnLL2lgBcK7FdhqHPfvcA2TK5sbkPUEOFQ7Wr KbX/wIruKJtUviKyzDEdSncg5DW/YfDMOYI8bDKaqLNacrVEnKGcdUSix5tLugHiTuTHdYE+HYo 8HcSXluYcJUB73mZ0l2E5D3ERUaCFLNs0DHz9 X-Google-Smtp-Source: AGHT+IG+LqAUABmPd3G9N3qoDqYsMp7M9godqPwJrCFqLajiM21cemzI63h/MFz9V5FypEdRPJ8CYcWzvSK3Mqj3DFI= X-Received: by 2002:a05:6808:158c:b0:3da:e007:9d5 with SMTP id 5614622812f47-3df05de5811mr18760701b6e.30.1725354440739; Tue, 03 Sep 2024 02:07:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Tue, 3 Sep 2024 14:36:44 +0530 Message-ID: Subject: Re: Require suggestions on issue #7811 To: Dave Page Cc: Pravesh Sharma , pgadmin-hackers@postgresql.org Content-Type: multipart/alternative; boundary="0000000000008d6af006213362fc" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008d6af006213362fc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Sep 3, 2024 at 2:05=E2=80=AFPM Dave Page wrote: > > > On Tue, 3 Sept 2024 at 09:29, Pravesh Sharma < > pravesh.sharma@enterprisedb.com> wrote: > >> Hi Dave, >> >> On Tue, Sep 3, 2024 at 1:47=E2=80=AFPM Dave Page wro= te: >> >>> Hi >>> >>> On Tue, 3 Sept 2024 at 09:10, Pravesh Sharma < >>> pravesh.sharma@enterprisedb.com> wrote: >>> >>>> Hi Hackers, >>>> >>>> I am working on issue #7811 >>>> , where using an >>>> external database for storing pgAdmin configuration results in duplica= te >>>> server entries when a container with a mapped servers.json file is >>>> restarted. >>>> >>>> The proposed solution is to implement a check when loading servers. We >>>> would verify the server=E2=80=99s name, host, port, and username to de= termine if >>>> the server already exists in the database. If it does, we would skip >>>> registering it again. >>>> >>>> >>>> Please share any suggestions or feedback on this approach. >>>> >>> >>> I would say "Won't fix". If someone is using persistent storage for >>> settings, why launch containers to import the same servers over and ove= r >>> again? Just load them once, manually. >>> >> What if the container needs to be restarted? In that case it will again >> import the server making a duplicate entry. >> > > Not if the servers are manually imported rather than through servers.json= . > Good point! > > -- > Dave Page > pgAdmin: https://www.pgadmin.org > PostgreSQL: https://www.postgresql.org > EDB: https://www.enterprisedb.com > > PGDay UK 2024, 11th September, London: https://2024.pgday.uk/ > > --=20 Thanks, Aditya Toshniwal pgAdmin Hacker | Sr. Software Architect | *enterprisedb.com* "Don't Complain about Heat, Plant a TREE" --0000000000008d6af006213362fc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Sep 3, 2024 at 2:05=E2=80=AF= PM Dave Page <dpage@pgadmin.org= > wrote:


On Tue, 3 Sept 2024 at 09:29, Pravesh Sha= rma <pravesh.sharma@enterprisedb.com> wrote:
Hi Dave,

On Tue, Sep = 3, 2024 at 1:47=E2=80=AFPM Dave Page <dpage@pgadmin.org> wrote:
Hi

On Tue, 3 Sep= t 2024 at 09:10, Pravesh Sharma <pravesh.sharma@enterprisedb.com> wrote= :
Hi Hackers,

I am working on issue #7811, where using = an external database for storing pgAdmin configuration results in duplicate= server entries when a container with a mapped servers.json file is restart= ed.


The proposed solution is to implement a check when loading= servers. We would verify the server=E2=80=99s name, host, port, and userna= me to determine if the server already exists in the database. If it does, w= e would skip registering it again.


Please share any suggestions or feedback on this approach.


I would say "Won&#= 39;t fix". If someone is using persistent storage for settings, why la= unch containers to import the same servers over and over again? Just load t= hem once, manually.=C2=A0
What if the co= ntainer=C2=A0needs to be restarted? In that case it will again import the s= erver making a duplicate entry.

Not if the servers are manually imported rather than through servers= .json.
Good point!=C2=A0
=C2=A0
-= -
Da= ve Page
PostgreSQL: https://www.postgresql.org

PGDay UK 2024, 11th Septemb= er, London: https://20= 24.pgday.uk/



--
Thanks,
Aditya Toshniwal
pgAdmin Hacker=C2=A0| Sr. Software Architect=C2=A0| enterprisedb.com