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 1tkj8K-006IWA-Ft for pgadmin-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 12:24:56 +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 1tkj8I-007wPd-Dp for pgadmin-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 12:24:54 +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 1tkj8I-007wPO-2D for pgadmin-hackers@lists.postgresql.org; Wed, 19 Feb 2025 12:24:54 +0000 Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tkj8D-001l7P-10 for pgadmin-hackers@postgresql.org; Wed, 19 Feb 2025 12:24:53 +0000 Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-6f77b9e0a34so47584937b3.2 for ; Wed, 19 Feb 2025 04:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1739967887; x=1740572687; 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=N7nbzBg2Qti1poLMEwOtK2Ozih1r6Abz9Ia9Aag93Lo=; b=U3NqbKc92XOUkEQCmIb4vllrTsK6oNDZQsEuh4JDP7vfmEIvskDBWKunaqi5psgmL+ J+2AAM4/FlwqKMSJU/k/3vQu8uYKnzi8LZoTuY3pU5R1nt3F8WjJrVSdhAat4Oi7H9We 1wfoWMh53wtaE7LpXcpMf/FHfr0/eroCJtQzk7ZI5onsZae6wB2Eh/D4L8qj09NdQ07Q QWiS14qrVdY+8QeQvWxhqqcX09/YGye+twvQWpCwmRqkKDnZvmR25BafxUs+quAeJIY7 NxFA/lxV78gXiBOrsKWlDTbSPquzKY7SB0o1MkXkowflBfU0JMQkydF2uM8gsetjw4Z9 tcNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739967887; x=1740572687; 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=N7nbzBg2Qti1poLMEwOtK2Ozih1r6Abz9Ia9Aag93Lo=; b=se2VieLEAYekWi3LAkXORP6cAXfogbRSPypqIgVUcRhckt4ltIzlS6dzREN3OKUb1N Zb+tdMHhpbDu8wk1tLuHRWVziOPZpaKNpAmXI1XpPOsKHu3lAWqgo1SKtaxybHe8lC0X NFmfkXC+2dtNvoF5HCatsoINndpizyunfQaojbstiyMmOxD63W0iTXwuDtPcmVnfbhG2 fIlSfDzsCjVfMcMmOZ889rKe326E4jWkfjHSmzs8T5ZmaI9Sau40Zx14fb5NkE5VaYl2 LlnF3JyzcL7E8sUOGCdTC8dnR5i1+Gh1MMOT7JnimsYceIuNHOJqBtoFkefbRaIcGR7Q I9HA== X-Forwarded-Encrypted: i=1; AJvYcCU5k6d6dS1BfyYcrgDFZTWXsIQ9i8mIGdzhsoV9oYQJYcjsuxMWJUk43n2bMkWsIDsorcDUqAOzwE9HJ89FFPw=@postgresql.org X-Gm-Message-State: AOJu0YxRPfvJEZzMlLTGelWv3U3Kl0uk0qnBSnIp/PbZ2Fi6JX/5hkU1 O9acwBVqA11FMvQ4aahceXlS141nX0X1B124bxz4xoDKnhAzMbgEUs1vL00Umq3rIvobPFZtTDw pSknBBENhi5iXqrj2vHMudVrLfpRW0OQ6aWJ3 X-Gm-Gg: ASbGncuB4K/WEBJBJgzx9wYhkiKnFpp5HeuG2f6vOE6b6x6dW3rCOavdAwjL7okTKyz kSnFN/9Bz9rODBCEBjDqu35na8/Q5rNXyFhPpmwVQ1BQPROIb+rKlI8F5EEiIdsHf3EIs8+R1c5 jL36hE0MsR8vP+ZzJOH9BVxVKsw09F X-Google-Smtp-Source: AGHT+IE/1NmNio9OvHWBkCbumXJlQWWD/9Ptce4o+U091QCXJq/0JZTzFvZpu3IYr0ZMhLW+uIjv/HA24werIL+mSbM= X-Received: by 2002:a05:690c:690e:b0:6f7:3e01:8a49 with SMTP id 00721157ae682-6fba57abe39mr32160847b3.26.1739967886255; Wed, 19 Feb 2025 04:24:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Yogesh Mahajan Date: Wed, 19 Feb 2025 17:54:09 +0530 X-Gm-Features: AWEUYZnylrC_-dJaDkq82TXLdPWjM1_Btzydck1_N1-FgClO7Wo2HQwpY8MwNO4 Message-ID: Subject: Re: Regarding feature #3319 To: Dave Page Cc: Aditya Toshniwal , Anil Sahoo , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000c805d8062e7dd732" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c805d8062e7dd732 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Wed, Feb 19, 2025 at 5:12=E2=80=AFPM Dave Page wrote= : > 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 persist= s >> 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 al= l > the session-changing side effects of every query, stored procedure/functi= on > 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. > If I understand correctly, Users are complaining about losing unsaved data in the query tool and not about data output or session state. Hence just reopening the query tool with only data should be suffice. Thanks, Yogesh Mahajan EnterpriseDB > > >> >> 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 >>> connection 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 op= en as >>> it is and will restore the workspace and connections on query tool t= abs. >>> 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 q= uery >>> 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 = in the >>> database as query history else not. Should we go with storing the wo= rkspace >>> and query tool details in SQLite DB or use a file system to store th= e >>> 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 unsave= d >>>> 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 >>>>> database 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 coul= d >>>>>> 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 >>>>>>>>> the Object explorer tree state but to save the contents of panels= we will >>>>>>>>> initially start with the Query tool. The below implementation wil= l 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'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 fil= e. Through >>>>>>>>> debouncing we will be able to call the API at certain intervals o= f user >>>>>>>>> interaction, and it will update the stored data related to worksp= ace 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" >> > > > -- > Dave Page > pgAdmin: https://www.pgadmin.org > PostgreSQL: https://www.postgresql.org > pgEdge: https://www.pgedge.com > > --000000000000c805d8062e7dd732 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi,
=
On Wed, Feb 19, 2025 at 5:12=E2=80=AFPM Dave Page <dpage@pgadmin.org> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);pa= dding-left:1ex">
Hi

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

<= /div>
Why not use browser loca= lStorage for saving this information? It persists when the browser closes a= nd is based on the URL. It is safer to store at the user's machine than= on our server.=C2=A0
Fo= r 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 d= ifferent machine. I think that's a compelling feature.

That said, I think this is largely irrelevant until the fundamenta= l problem is solved. e.g. how do we restore the state of the session (spoil= er: it's almost certainly not possible, unless we can figure out all th= e session-changing side effects of every query, stored procedure/function e= tc. that may have been directly or indirectly called).

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

If I understand correctly, Us= ers are complaining=C2=A0about losing unsaved data in the query tool and no= t about data output or session state. Hence just reopening the query tool w= ith only data should be=C2=A0suffice.

Thanks,
Yogesh Mahajan
EnterpriseDB=C2=A0
=C2=A0

On Wed, Aug 28, 2024 at 12:50=E2=80=AFPM Anil Sahoo <anil.sahoo@enterprised= b.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"


--
--000000000000c805d8062e7dd732--