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 1slPtX-007XM2-4V for pgadmin-hackers@arkaria.postgresql.org; Tue, 03 Sep 2024 09:32:15 +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 1slPtW-009XEx-95 for pgadmin-hackers@arkaria.postgresql.org; Tue, 03 Sep 2024 09:32:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slPtW-009XEp-00 for pgadmin-hackers@lists.postgresql.org; Tue, 03 Sep 2024 09:32:14 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1slPtS-000R8T-Er for pgadmin-hackers@postgresql.org; Tue, 03 Sep 2024 09:32:13 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-6d47d860fc4so26843797b3.3 for ; Tue, 03 Sep 2024 02:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1725355928; x=1725960728; 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=DwoznC9EXhX0i9eQKLS4bGRf+AhdfAJSNIvpIxc6hvU=; b=Ndso2o1rdrDatrSzdEExmQL2L8Wi3dqsDkTx4EO63vq8NguUw0SebvSgyXG1UlCHzj eR4WLAW4N4Gp72ZEO5gC8XzEdlc84HYSOFgXs9a5J80MKWkKcWEna11sohjUgp6j+M41 9Zcn2vWX8OVTNf4k0y+bxRaoN0Xrhy2sOob9TjYgAOOT5sH8OmQ/fzFj1qJ3Fahr4ovg Jy5rp3IGKetoZsKjZmDprKoQiNKr/G7mNXGvvifw+F9IZecY36yhxpPoepNSCdpSpEE0 aRJ60MHCe5IlVppvbyJrKS9eUdBDdprrRisjcfI26I/prZDsS64ZzbXCZQNCDpIB+F76 QKsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725355928; x=1725960728; 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=DwoznC9EXhX0i9eQKLS4bGRf+AhdfAJSNIvpIxc6hvU=; b=BZO4Vn1Su0l+lutwoVM8P0gtWvuJ3J4svTQl8zNCFFfcJmCJqFUWEo0ks3LQ58sMTo OVhoeAfswBy/rcEZeHDppU77oQUBSh6ukEpduPqUt5znQtTJSS80sON2IFxQod0qloaR 4AzQ4FCIMg2qyxLVxuaWFrd0VgklGoY3T6l6JwOSBNwm6Sp4v02gQGaIKrX0jXycFUis z+DsnzdASf5c3ed4nFiIiTWr8S2BU/1M4YXfEVBaLJ25OAEPkl2ggchweA64gtQbpGZG ZXCmCd1SoUUlbUCI267SK+/plunXF+FG2P3z6XvzwtZ/65iXTZUb8iV/8MCwu81KdBvG okNQ== X-Forwarded-Encrypted: i=1; AJvYcCW8ybiCm9AicB1p2j/QHmcrBdIjzR4xFbNUw7dtGKoXht/oqcfaj6DZ0Ac//zCY6GaBVWXQPG88fme39OiqRHo=@postgresql.org X-Gm-Message-State: AOJu0Ywl9LRiy7HcM3E4KT58sEz2Wwr+YbvlU0r/WOOJ0iVSmSajP1rU 6CxJyQ3ca/N279hjVD1QnrCCTE/6JRud2jdLV2J0kUJYOExt6IriP93An+XdTJfi/nPbDrTR1Rp Q8TSBsC0RKjltZcfN1Z+SEWcG8w09QMWAtaB2SY+mXY2HYZjC6w== X-Google-Smtp-Source: AGHT+IEqF+mt98DrOgXcLIiTqa8KpbAxonXJlX4xI9ZZmhNkuv2I4xXsABRE8shTLU/4u4/bZ9CLLaQadb628OJPBts= X-Received: by 2002:a05:690c:ed2:b0:6d3:c673:e57a with SMTP id 00721157ae682-6d40d987ad8mr137303577b3.5.1725355928333; Tue, 03 Sep 2024 02:32:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Yogesh Mahajan Date: Tue, 3 Sep 2024 15:01:31 +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="0000000000003859a9062133bbc1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003859a9062133bbc1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Dave, This isn't the issue in the case of sqlite db while using persistent storage. Issue appears only if external database is used as pgadmin configuration db. Just having different way of persistent storage( in this case backend database) behaviour should not be different. Also, on restart admin user specified while container is not recreated. Can't we fix on similar lines? Thanks, Yogesh Mahajan EnterpriseDB 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= . > > -- > 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/ > > --0000000000003859a9062133bbc1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dave,

<= /div>
This isn't the issue in the case of sqlite db while usi= ng persistent storage. Issue appears only if external database is used as p= gadmin configuration db. Just having different way=C2=A0of persistent stora= ge( in this case backend database) behaviour should not be different.=C2=A0=

Also, on restart admin user specified= while container is not recreated. Can't we fix on similar lines?
=

Thanks,
Yogesh Mahajan
EnterpriseDB

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


On Tue, 3 Sept 2024 at 09:2= 9, Pravesh Sharma <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 Sept 2024 at 09:10, Pravesh Sharma <pravesh.sharma@enterp= risedb.com> wrote:
Hi Ha= ckers,

I am working on issue #7811= , where using an external database for storing pgAdmin configuration result= s in duplicate server entries when a container with a mapped servers.json f= ile 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 determine if the server already e= xists in the database. If it does, we would skip registering it again.

<= p style=3D"margin:0px;font-stretch:normal;font-size:13px;line-height:normal= ;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:= auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-vari= ant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:nor= mal">

Please share any suggestions or feedback on this approac= h.


I would say "= Won't fix". If someone is using persistent storage for settings, w= hy launch containers to import the same servers over and over again? Just l= oad them once, manually.=C2=A0
What if t= he container=C2=A0needs 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 se= rvers.json.
=C2=A0
--
Dave Page

PGDay UK 2024, 11th Se= ptember, London: https= ://2024.pgday.uk/

--0000000000003859a9062133bbc1--