From aa5d2826d903cc0b230a55ba86e8c22329c4bc0e Mon Sep 17 00:00:00 2001 From: pavanmanishd Date: Sat, 21 Mar 2026 11:53:54 +0530 Subject: [PATCH 1/3] [#9699] Close tab on middle-click Add onMouseDown handler to the tab close button that fires layoutDocker.close() when mouse button 1 (middle click) is pressed. preventDefault() stops the browser's auto-scroll cursor from appearing. This matches the standard UX in Chrome, Firefox, and VS Code where middle-click on a tab closes it. --- web/pgadmin/static/js/helpers/Layout/index.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/pgadmin/static/js/helpers/Layout/index.jsx b/web/pgadmin/static/js/helpers/Layout/index.jsx index 9b93cfe8719..e18fc1ed833 100644 --- a/web/pgadmin/static/js/helpers/Layout/index.jsx +++ b/web/pgadmin/static/js/helpers/Layout/index.jsx @@ -67,6 +67,8 @@ export function TabTitle({id, closable, defaultInternal}) { {attrs.title} {closable && } size="xs" noBorder onClick={()=>{ layoutDocker.close(id); + }} onMouseDown={(e)=>{ + if(e.button === 1) { e.preventDefault(); layoutDocker.close(id); } }} style={{margin: '-1px -10px -1px 0'}} />} ); From 78a079cb1231e3fa3cf0c345237013de1e147fcb Mon Sep 17 00:00:00 2001 From: pavanmanishd Date: Sat, 21 Mar 2026 11:54:13 +0530 Subject: [PATCH 2/3] [#9677] Generate ALTER TABLE SET UNLOGGED/LOGGED when persistence changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Unlogged toggle in Table Properties was read-only — toggling it and saving did not generate any DDL. Both the default/ and 11_plus/ update.sql templates were missing the relpersistence alter block. Add the missing section to both templates: ALTER TABLE ... SET UNLOGGED; (when relpersistence toggled on) ALTER TABLE ... SET LOGGED; (when relpersistence toggled off) The relpersistence value is already fetched by properties.sql and tracked in the form; this change wires it through to the DDL generation. --- .../tables/templates/tables/sql/11_plus/update.sql | 8 ++++++++ .../tables/templates/tables/sql/default/update.sql | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/update.sql index 591ed675ee0..7dcad70b160 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/update.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/update.sql @@ -49,6 +49,14 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET {% if data.relhasoids %}WITH{% else %}WITHOUT{% endif %} OIDS; +{% endif %} +{#####################################################} +{## Change table persistence (UNLOGGED / LOGGED) ##} +{#####################################################} +{% if data.relpersistence is defined and data.relpersistence != o_data.relpersistence %} +ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} + SET {% if data.relpersistence %}UNLOGGED{% else %}LOGGED{% endif %}; + {% endif %} {#####################################################} {## Change tablespace ##} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/update.sql index f1b4625a2ac..61eda61e140 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/update.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/update.sql @@ -49,6 +49,14 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET {% if data.relhasoids %}WITH{% else %}WITHOUT{% endif %} OIDS; +{% endif %} +{#####################################################} +{## Change table persistence (UNLOGGED / LOGGED) ##} +{#####################################################} +{% if data.relpersistence is defined and data.relpersistence != o_data.relpersistence %} +ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} + SET {% if data.relpersistence %}UNLOGGED{% else %}LOGGED{% endif %}; + {% endif %} {#####################################################} {## Change tablespace ##} From 5524428dfdab02b97ad44b3a85b0a299407d9067 Mon Sep 17 00:00:00 2001 From: pavanmanishd Date: Sun, 22 Mar 2026 14:41:46 +0530 Subject: [PATCH 3/3] [#9677] Remove unrelated tab middle-click change --- web/pgadmin/static/js/helpers/Layout/index.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/pgadmin/static/js/helpers/Layout/index.jsx b/web/pgadmin/static/js/helpers/Layout/index.jsx index e18fc1ed833..9b93cfe8719 100644 --- a/web/pgadmin/static/js/helpers/Layout/index.jsx +++ b/web/pgadmin/static/js/helpers/Layout/index.jsx @@ -67,8 +67,6 @@ export function TabTitle({id, closable, defaultInternal}) { {attrs.title} {closable && } size="xs" noBorder onClick={()=>{ layoutDocker.close(id); - }} onMouseDown={(e)=>{ - if(e.button === 1) { e.preventDefault(); layoutDocker.close(id); } }} style={{margin: '-1px -10px -1px 0'}} />} );