pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Workspace and query windows not saved on restart (RM #5193)

Open dpage opened this issue 5 years ago • 8 comments

Issue migrated from Redmine: https://redmine.postgresql.org/issues/5193 Originally created by Bilge B at 2020-02-15 09:36:55 UTC.

If the application is restarted, either deliberately or otherwise, all the work in however many open query windows is permanently lost. It should be clear that preserving work and the application state is better than not, whether or not the user actually cares about the content of those windows, but especially when they do. I realize each query can be manually saved to disk, but even in that case, the same open query windows should be presented when the application reloads so the workspace state is always preserved instead of reset to a blank slate each time.

dpage avatar Feb 15 '20 09:02 dpage

Comment migrated from Redmine: https://redmine.postgresql.org/issues/5193#note-1 Originally created by Aditya Toshniwal at 2020-02-21 11:27:19 UTC.

Redmine ticket header update:

Name Old Value New Value
Priority changed High Normal
Sprint changed Ready

dpage avatar Feb 21 '20 11:02 dpage

Comment migrated from Redmine: https://redmine.postgresql.org/issues/5193#note-2 Originally created by Yogesh Mahajan at 2021-04-02 11:49:06 UTC.

Redmine ticket header update:

Name Old Value New Value
Relationship (duplicated) changed RM #6342

dpage avatar Apr 02 '21 11:04 dpage

Comment migrated from Redmine: https://redmine.postgresql.org/issues/5193#note-3 Originally created by Akshay Joshi at 2021-06-11 11:21:38 UTC.

Redmine ticket header update:

Name Old Value New Value
Relationship (duplicated) changed RM #6515

dpage avatar Jun 11 '21 11:06 dpage

This would be an extremely helpful feature, is it still slated to be developed?

ajsmith-savills avatar Jul 11 '24 08:07 ajsmith-savills

This feature has been requested every day for the past decade. They are never going to do it.

Bilge avatar Jul 11 '24 08:07 Bilge

I see I filed a duplicate request for this. I hope you'll prioritize it.

anthonydb avatar Feb 12 '25 12:02 anthonydb

They will never.

On Wed, 12 Feb 2025, 12:15 Anthony DeBarros, @.***> wrote:

I see I filed a duplicate request for this. I hope you'll prioritize it.

— Reply to this email directly, view it on GitHub https://github.com/pgadmin-org/pgadmin4/issues/3319#issuecomment-2653544463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADS4YWNAVJMPJJUFAKTQXD2PM3O7AVCNFSM6AAAAABW7OXBH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJTGU2DINBWGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Bilge avatar Feb 12 '25 12:02 Bilge

This feature is already included in the sprint, but due to higher-priority tasks, we are unable to prioritize its implementation.

akshay-joshi avatar Feb 12 '25 12:02 akshay-joshi

This would be really nice! A definite missing feature coming from mysql workbench.

Amnesiac9 avatar May 14 '25 04:05 Amnesiac9

As part of the feature we have added new preference 'Miscellaneous > User Interface > Save Application State', whether to preserve tools windows and data. If this setting is turned on, tools window and its data will be saved to pgadmin configuration db. On abrupt shutdown/ refresh of the pgadmin , these tools will be restored with the the respective data.

yogeshmahajan-1903 avatar Jun 06 '25 04:06 yogeshmahajan-1903

@Bilge , @anthonydb May you can give a try on snapshot build before it release .

yogeshmahajan-1903 avatar Jun 06 '25 04:06 yogeshmahajan-1903

@yogeshmahajan-1903 I installed the latest snapshot. I noted that Save the application state? was set to true by default. I opened the CREATE SCRIPT for a table as well as a query window in which I wrote a query and executed it. I then force quit pgadmin. Upon running pgadmin again, the two query windows were restored with the SQL they contained previously. Awesome!

The window where I had run the query and had the resulting data table did not preserve the data table but I'm not sure if if that's what's meant by:

tools window and its data will be saved

I noted that the Object Explorer was not restored to prior state. Would make a nice stretch goal.

Running on M4 Mac Sequoia 15.1.1

I am glad this feature finally saw the light of the day. Thank you!

aergul avatar Jun 06 '25 05:06 aergul

@yogeshmahajan-1903 I installed the latest snapshot. I noted that Save the application state? was set to true by default. I opened the CREATE SCRIPT for a table as well as a query window in which I wrote a query and executed it. I then force quit pgadmin. Upon running pgadmin again, the two query windows were restored with the SQL they contained previously. Awesome!

The window where I had run the query and had the resulting data table did not preserve the data table but I'm not sure if if that's what's meant by:

tools window and its data will be saved

I noted that the Object Explorer was not restored to prior state. Would make a nice stretch goal.

Running on M4 Mac Sequoia 15.1.1

I am glad this feature finally saw the light of the day. Thank you!

You are correct, result grid data will NOT be restored.It will only restore only query editor content. In case of Schema diff - Only selected servers/db/schemas (not a comparison result), Psql - Only the psql windows with connection (no queries will be preserved.)

yogeshmahajan-1903 avatar Jun 06 '25 05:06 yogeshmahajan-1903

Looks good to me.

  • ✅ Option enabled by default.
  • ✅ Restores my query windows with the queries intact.

That's all I ever wanted! Is this data still going to be persisted when upgrading?

Bilge avatar Jun 06 '25 08:06 Bilge

Opened three files and closed the program. All three were in the workspace when I re-opened it, so seems to work. Nice feature, thank you for implementing.

anthonydb avatar Jun 06 '25 10:06 anthonydb

Found the 2 issues below during initial testing:

  1. If I have multiple tools tabs open and then continuously close them, and then close and reopen pgAdmin, only one tab is closed while the others remain open (If I have different tools tab opened and close them then also behaviour is not consistent).
  2. The schema diff tool state is not being saved.

pravesh-sharma avatar Jun 11 '25 12:06 pravesh-sharma

⚠ One issue I have found is that, although my query windows are saved, their order is not. In fact, when I restarted my computer and re-opened the application, it seemed my tabs were loaded in reverse order... very confusing!

Bilge avatar Jun 14 '25 08:06 Bilge

❗ OK this is definitely not working properly. I keep closing tabs, but every time I restart the application, more and more dead tabs that I closed days or even weeks ago keep reappearing, even tabs that I have now closed multiple times keep being resurrected by restarting the app.

Bilge avatar Jun 24 '25 17:06 Bilge

❗ OK this is definitely not working properly. I keep closing tabs, but every time I restart the application, more and more dead tabs that I closed days or even weeks ago keep reappearing, even tabs that I have now closed multiple times keep being resurrected by restarting the app.

Above issue was reported while testing. Fix is available in 9.5 release or you can try the latest nightly build.

yogeshmahajan-1903 avatar Jun 25 '25 03:06 yogeshmahajan-1903

Tested and verified on latest candidate and snapshot build.

Created a separate issue for tab order not restoring correctly. #8901

pravesh-sharma avatar Jun 30 '25 11:06 pravesh-sharma

I just "up"graded to 9.6 and lost all my queries! I try to downgrade to 9.5 to get them back, but the installer just blocks me with "A newer version of pgAdmin is already installed" 🤦🏻‍♂️

Bilge avatar Jul 31 '25 09:07 Bilge