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 1tkiSr-006DXd-ME for pgadmin-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 11:42:06 +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 1tkiSp-007gTp-4w for pgadmin-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 11:42:03 +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 1tkiSo-007gTh-BA for pgadmin-hackers@lists.postgresql.org; Wed, 19 Feb 2025 11:42:03 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tkiSl-001koS-2g for pgadmin-hackers@postgresql.org; Wed, 19 Feb 2025 11:42:02 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-30613802a59so68928541fa.0 for ; Wed, 19 Feb 2025 03:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin.org; s=google; t=1739965318; x=1740570118; 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=6TOAVB9+rMgM7OQJkalcJW1TNZ6earSUUjRTeAzeX30=; b=gNyCjs18neB1JGx6cI9vNwx55pqJzVUx/M/WhZrdJWVZtfhm+w1XYPLa2dv5v1LvPt OfyLWM6WosSTu5DkKrxd1im+p9k3KTpFKwk/O9mcdlTToETe4iO+3S0Ter/nmfDNYz2r 0z5oNci4YrJ/c6glYegyfm9bMwfFqUCnZbAX/dYj6xzaa+qCSAD8pl4BLF8FSv4neNwC 03SlUryahaksIWppzMGqN45tFJzXeYoJeEZzNfWRHJ693jqZbpxCN0gcb/+ES7kewF8A ZgB6oouvE8eSW4e/MAnCInN/kovyLEM/EvtFR+ycvDE39COEUL4zZs9HFUxS1kgSDcRx jGTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739965318; x=1740570118; 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=6TOAVB9+rMgM7OQJkalcJW1TNZ6earSUUjRTeAzeX30=; b=hE55d7aatKfHSu3fQtw2+NFkzIyWFtjRhw0NlQtRviCYdeYF9cNFGtdNNWFadzLKWE LXigZOC0axupJ+d/IVvL7INBMc22nV/4/DXQNPkUe5zP+zC1IfCtQsSKa/o1HdoFscpd 0SklyXAiDtYwLP+oebL5z0pcPjeL4cwHadWh2lDXr0fOnZVeG0oF/XRcvSrplazv44Su zlZGVGmPXPkJTS3zbn1xfytYFNJlyUWIxda7DXRImT+mNMiKpuzol/fww+MOPIxaKh/+ itlMAZFsvUT7qUrGY2V/Lq/smI45gyXOfzO2JiFYX45YNc/Hj/8V8P8EAnHI+P4HwKl+ hY+g== X-Forwarded-Encrypted: i=1; AJvYcCWbU+UOqiFlMC1gmVOdRhWL5ScmNiOBE0OF2A7pPit1YRpPJM1Ch7eB2ZHHJZJO0pJDIQAscggwzOgZ2ULUHWw=@postgresql.org X-Gm-Message-State: AOJu0YxHHZ7+WUuPGVpI6C8TN15o/L9NVRtBLwkNPu9jWiwBZ3A1sVxi BnrXyy9/V2xCbiwu5tBvbtEQhO3+6cqboR4W2p0uTcdAJfQ5zE8wOJN5cr2qXBOA79MsLEnudzz 6a36MfDLq4kQBGqcWHPYjgqLh2tmKED85XDAm X-Gm-Gg: ASbGncsqtJJIPGaqsOrrUilBngk2qXNogSPAbrtaou2BiPE5tDx2bh6Cr3Ul+rSUuBG BV22a7gh5nRhdu8P/bim5M2tByZFHSULpw5vNDSbhhhszfCdyQPCNB4dOl7ka5+CzWwuEayonsL w= X-Google-Smtp-Source: AGHT+IFiSMqczZQa7U5HYBAzcevps6xpupeMJWOlBMw5ixcyBoRB5SrPHylNTBP8sgT/ZQYeUOk6VknLUOnfA01MygM= X-Received: by 2002:a05:6512:3e1d:b0:545:381:70a with SMTP id 2adb3069b0e04-5462eedec67mr1374943e87.15.1739965317263; Wed, 19 Feb 2025 03:41:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Wed, 19 Feb 2025 11:41:46 +0000 X-Gm-Features: AWEUYZnP_jOb6uzC2BuD2rCIqsQLa8H8-KqnKWpX8Oox3vnyKxuKnUUPkjuiLgM Message-ID: Subject: Re: Regarding feature #3319 To: Aditya Toshniwal Cc: Anil Sahoo , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000a84f33062e7d3eae" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a84f33062e7d3eae Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi On Thu, 16 Jan 2025 at 06:37, Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > Hi Anil/Dave, > > Why not use browser localStorage for saving this information? It persists > when the browser closes and is based on the URL. It is safer to store at > the user's machine than on our server. > For Electron also it should work. > This will reduce load on the pgAdmin server. > Because it stores it at the users machine and not on the pgAdmin server, and thus state cannot be restored if the user is on a different machine. I think that's a compelling feature. That said, I think this is largely irrelevant until the fundamental problem is solved. e.g. how do we restore the state of the session (spoiler: it's almost certainly not possible, unless we can figure out all the session-changing side effects of every query, stored procedure/function etc. that may have been directly or indirectly called). Or, we make a decision not to bother with that, and to give the user suitable warnings such as we do when we perform a reconnect. > > On Wed, Aug 28, 2024 at 12:50=E2=80=AFPM Anil Sahoo > wrote: > >> Hi Hackers, >> >> >> We are going to store the below details >> >> 1. List of Query tools opened >> 2. List of connections present in each query tool >> 3. Each connection=E2=80=99s details that are required to make the co= nnection >> once the application restarts >> 4. Active connection details of each query tool opened >> 5. Store the query that is written in the editor that may or may not >> be executed >> 6. Store the contents of the scratch pad >> 7. Store the file which is opened in the query tool with any unsaved >> changes >> >> Some questions that I have are mentioned below, >> >> 1. For desktop mode the application is opened with some query tools >> and the user closes the application and on restarts the tabs will ope= n as >> it is and will restore the workspace and connections on query tool ta= bs. >> But for server mode do we need to restore the query tool tabs and >> workspace? Because we see most of the desktop applications have this >> feature. >> 2. I came across one issue reported by one user i.e >> https://github.com/pgadmin-org/pgadmin4/issues/6666, where pgAdmin >> crashed due to long SQL scripts that can be in Megabytes stored as qu= ery >> history. We fixed it by giving MAX_QUERY_LENGTH to 1000000, and >> checking if any query length is below the value then it gets stored i= n the >> database as query history else not. Should we go with storing the wor= kspace >> and query tool details in SQLite DB or use a file system to store the >> details and retrieve the content accordingly? >> >> >> Please let me know your suggestions on this. >> >> Thanks >> Anil >> -- >> >> >> >> *Anil Sahoo* >> >> Software Engineer >> >> www.enterprisedb.com >> >> Power to Postgres >> >> >> >> >> >> >> >> On Tue, Aug 20, 2024 at 10:14=E2=80=AFAM Aditya Toshniwal < >> aditya.toshniwal@enterprisedb.com> wrote: >> >>> Hi Anil, >>> >>> There can be multiple query tools open with large files. Not entirely >>> sure if storing in SQLite DB is a good idea. >>> External databases won't come in the picture as 99.99% users will not >>> use external DB for desktop app. We're only doing this for desktop app. >>> And also consider the case where a SQL file is opened with some unsaved >>> changes. >>> >>> On Tue, Aug 20, 2024 at 9:11=E2=80=AFAM Anil Sahoo >>> wrote: >>> >>>> Hi Aditya, >>>> >>>> As we are already storing the query history in the pgAdmin 4's databas= e >>>> file. >>>> I am planning to store the information the same way. That can be an >>>> internal database file like SQLite or external database. >>>> >>>> Let me know if you all have any suggestions on this. >>>> >>>> Thanks >>>> Anil >>>> -- >>>> >>>> >>>> >>>> *Anil Sahoo* >>>> >>>> Software Engineer >>>> >>>> www.enterprisedb.com >>>> >>>> Power to Postgres >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Mon, Aug 19, 2024 at 11:40=E2=80=AFAM Aditya Toshniwal < >>>> aditya.toshniwal@enterprisedb.com> wrote: >>>> >>>>> Hi Anil, >>>>> >>>>> On Mon, Aug 12, 2024 at 3:02=E2=80=AFPM Anil Sahoo < >>>>> anil.sahoo@enterprisedb.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> Yes, We will store the details that are needed to re-establish the >>>>>> connection. >>>>>> >>>>> >>>>> How/Where are you planning to store the information? Query text could >>>>> be large. >>>>> >>>>>> >>>>>> Regards >>>>>> Anil >>>>>> -- >>>>>> >>>>>> >>>>>> >>>>>> *Anil Sahoo* >>>>>> >>>>>> Software Engineer >>>>>> >>>>>> www.enterprisedb.com >>>>>> >>>>>> Power to Postgres >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Aug 12, 2024 at 2:08=E2=80=AFPM Dave Page wrote: >>>>>> >>>>>>> Hi >>>>>>> >>>>>>> On Mon, 12 Aug 2024 at 06:50, Anil Sahoo < >>>>>>> anil.sahoo@enterprisedb.com> wrote: >>>>>>> >>>>>>>> Hi Hackers, >>>>>>>> >>>>>>>> >>>>>>>> This feature #3319 >>>>>>>> , demands the >>>>>>>> Workspace and the Query tool panel to be saved before exiting the >>>>>>>> application and on restart it will show earlier opened panels. >>>>>>>> >>>>>>>> >>>>>>>> We are already saving the Browser layout, Query tool layout and th= e >>>>>>>> Object explorer tree state but to save the contents of panels we w= ill >>>>>>>> initially start with the Query tool. The below implementation will= be done, >>>>>>>> >>>>>>>> 1. Store the query tool panels and the list of connections >>>>>>>> present in each query tool panel and the active connection >>>>>>>> 2. Store the query that is written in the editor >>>>>>>> 3. Store the contents of scratch pad >>>>>>>> >>>>>>>> The main reason that this has never been worked on is that there i= s >>>>>>> no way to restore the state of a connection to what it was and be s= ure >>>>>>> we've got it right. How do you propose to handle that? I assume in = a >>>>>>> similar way to the warnings we give if a connection has to be >>>>>>> re-established? >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> We will use debouncing to store the workspace data and all other >>>>>>>> data related to panels in the pgAdmin 4's configured database file= . Through >>>>>>>> debouncing we will be able to call the API at certain intervals of= user >>>>>>>> interaction, and it will update the stored data related to workspa= ce and >>>>>>>> all other panels. >>>>>>>> >>>>>>> >>>>>>> OK. >>>>>>> >>>>>>> -- >>>>>>> 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/ >>>>>>> >>>>>>> >>>>> >>>>> -- >>>>> Thanks, >>>>> Aditya Toshniwal >>>>> pgAdmin Hacker | Sr. Software Architect | *enterprisedb.com* >>>>> >>>>> "Don't Complain about Heat, Plant a TREE" >>>>> >>>> >>> >>> -- >>> Thanks, >>> Aditya Toshniwal >>> pgAdmin Hacker | Sr. Software Architect | *enterprisedb.com* >>> >>> "Don't Complain about Heat, Plant a TREE" >>> >> > > -- > Thanks, > Aditya Toshniwal > pgAdmin Hacker | Sr. Staff SDE II | *enterprisedb.com* > > "Don't Complain about Heat, Plant a TREE" > --=20 Dave Page pgAdmin: https://www.pgadmin.org PostgreSQL: https://www.postgresql.org pgEdge: https://www.pgedge.com --000000000000a84f33062e7d3eae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, 16 Jan 2025 at 06:37,= Aditya Toshniwal <= aditya.toshniwal@enterprisedb.com> wrote:
=
Hi=C2=A0Anil= /Dave,

Why not use browser localStorage for= saving this information? It persists when the browser closes and is based = on the URL. It is safer to store at the user's machine than on our serv= er.=C2=A0
For Electron a= lso it should work.
This= will reduce load on the pgAdmin server.

<= /div>
Because it stores it at the users machine and not on the pgAdmin = server, and thus state cannot be restored if the user is on a different mac= hine. I think that's a compelling feature.

Tha= t said, I think this is largely irrelevant until the fundamental problem is= solved. e.g. how do we restore the state of the session (spoiler: it's= almost certainly not possible, unless we can figure out all the session-ch= anging side effects of every query, stored procedure/function etc. that may= have been directly or indirectly called).

Or, we = make a decision not to bother with that, and to give=C2=A0the user suitable= warnings such as we do when we perform a reconnect.
=C2=A0
=

On Wed, Aug 28, 2024 at 12:50=E2=80=AFPM Anil Sahoo <anil.sahoo@enterp= risedb.com> wrote:

Hi Hackers,


We are going to store the below details

  1. List of Query tools opened
  2. List of connections present in each query to= ol
  3. Each connection=E2=80=99s details that are r= equired to make the connection once the application restarts
  4. Active connection details of each query tool= opened
  5. Store the query that is written in the edito= r that may or may not be executed
  6. Store the contents of the scratch pad=
  7. Store the file which is opened in the query = tool with any unsaved changes

Some questions that I have are mentioned belo= w,

  1. For desktop mode the application is opened w= ith some query tools and the user closes the application and on restarts th= e tabs will open as it is and will restore the workspace and connections on= query tool tabs. But for server mode do we need to restore the query tool = tabs and workspace? Because we see most of the desktop applications have th= is feature.=C2=A0
  2. I came across one issue reported by one user= i.e https://github.com/pgadmi= n-org/pgadmin4/issues/6666, where pgAdmin crashed due to long SQ= L scripts that can be in Megabytes stored as query history.=C2=A0 We fixed it by giving MAX_QUERY_LENGTH=C2=A0 to 1000000, a= nd checking if any query length is below the value then it gets stored in t= he database as query history else not. Should we go with storing the worksp= ace and query tool details in SQLite DB or use a file system to store the d= etails and retrieve the content accordingly?

Please let me know your suggesti= ons on this.

<= /div>
Thanks
Anil
--
<= table style=3D"border:medium;border-collapse:collapse">

Anil Sahoo

<= span style=3D"font-size:13.3333px;white-space:pre-wrap">Software Engineer

www.enterprisedb.com

Power to Postgres

<= a href=3D"https://www.linkedin.com/company/edbpostgres" target=3D"_blank"><= span style=3D"font-size:11pt;font-family:Roboto,sans-serif;color:rgb(17,85,= 204);vertical-align:baseline;white-space:pre-wrap">= =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0



=
On Tue, Aug 20, 2024 at 10:14=E2=80= =AFAM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
=
Hi Anil,

=
There can be multiple q= uery tools open with large files. Not entirely sure if storing in SQLite DB= is a good idea.
Externa= l databases won't come in the picture as 99.99% users will not use exte= rnal DB for desktop app. We're only doing this for desktop app.
And also consider the case wher= e a SQL file is opened with some unsaved changes.

On Tue, Aug 20, 2024= at 9:11=E2=80=AFAM Anil Sahoo <anil.sahoo@enterprisedb.com> wrote:
Hi Aditya,

As we are= already storing the query history in the pgAdmin 4's database file.
I am planning to store the information the same way. That can be an= internal database file like SQLite or external database.=C2=A0

Let me know if you all have any suggestions on this.

Thanks
Anil
--

<= span>

Anil Sahoo<= /b>

Software Engineer

= www.ent= erprisedb.com

Power to Postgres

=C2=A0 =C2=A0 =C2=A0 = = =C2=A0 = =C2=A0 = =C2=A0 =C2=A0



On Mon, Aug 19, 2024 at 11:40=E2=80=AFAM Adit= ya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi=C2=A0Anil,

<= div dir=3D"ltr" class=3D"gmail_attr">On Mon, Aug 12, 2024 at 3:02=E2=80=AFP= M Anil Sahoo <anil.sahoo@enterprisedb.com> wrote:
Hi,

Yes, We will store the details that are needed= to re-establish the connection.

How/Where are you planning=C2=A0to sto= re the information? Query text could be large.

Regards
Anil
--

Anil Sahoo

Software Engineer

www.enterprise= db.com

Power to Postgres

<= /span>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = <= span style=3D"font-size:11pt;font-family:Roboto,sans-serif;color:rgb(17,85,= 204);vertical-align:baseline;white-space:pre-wrap">= =C2=A0 = =C2=A0 =

=


On Mon, Aug 12, 2024 at 2:08=E2=80=AFPM Dave Page <= ;dpage@pgadmin.org> wrote:

<= div class=3D"gmail_quote">
On Mon, 12 = Aug 2024 at 06:50, Anil Sahoo <anil.sahoo@enterprisedb.com> wrote:

Hi Hackers,


This feature=C2=A0#3319, demands the Wor= kspace and the Query tool panel to be saved before exiting the application = and on restart it will show earlier opened panels.


We are already saving the Browser layout, Query tool layout and the= Object explorer tree state but to save the contents of panels we will init= ially start with the Query tool. The below implementation will be done,

  1. Store the query tool panels and the list of connections present in= each query tool panel and the active connection
  2. Store the query that is written in the editor
  3. Store the contents of scratch pad
The main reason that this has never been worked on is that there is= no way to restore the state of a connection to what it was and be sure we&= #39;ve got it right. How do you propose to handle that? I assume in a simil= ar way to the warnings we give if a connection has to be re-established?=C2= =A0


We will use debouncing to store the workspace data and all other da= ta related to panels in the pgAdmin 4's configured database file. Throu= gh debouncing we will be able to call the API at certain intervals of user = interaction, and it will update the stored data related to workspace and al= l other panels.


OK.=C2=A0<= /div>

-- =
Dave PagepgAdmin: https://w= ww.pgadmin.org
PostgreSQL: https://www.postgresql.org

PGDay UK 2024, 11th September, Londo= n: https://2024.pgday.= uk/



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

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

--
Thanks,
Aditya Toshniw= al
pgAdmin Hacker=C2=A0| Sr. Staff SDE II=C2= =A0| enterprisedb.com
"Don't Complain about Heat, Plant a TREE"


--
--000000000000a84f33062e7d3eae--