From bd252cae30bc371064b50f8e7dcec46909e571b0 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Wed, 19 Aug 2026 11:30:20 +0100 Subject: [PATCH 1/3] fix: correct existingSecret path in Helm deployment template (#10214) The annotation conditions referenced the non-existent top-level .Values.existingSecret instead of .Values.auth.existingSecret, so the secret checksum annotation and the empty-secret gating never worked as intended when an existing secret wasn't supplied. --- pkg/helm/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/helm/templates/deployment.yaml b/pkg/helm/templates/deployment.yaml index 5c12294868b..854e809180c 100644 --- a/pkg/helm/templates/deployment.yaml +++ b/pkg/helm/templates/deployment.yaml @@ -32,12 +32,12 @@ spec: {{- with omit .Values.commonLabels "app" }} {{- . | toYaml | nindent 8 }} {{- end }} - {{- if or (not (empty .Values.commonAnnotations)) (not .Values.existingSecret) .Values.preferences.enabled .Values.serverDefinitions.enabled }} + {{- if or (not (empty .Values.commonAnnotations)) (empty .Values.auth.existingSecret) .Values.preferences.enabled .Values.serverDefinitions.enabled }} annotations: {{- with .Values.commonAnnotations }} {{- . | toYaml | nindent 8 }} {{- end }} - {{- if not .Values.existingSecret }} + {{- if empty .Values.auth.existingSecret }} checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} {{- end }} {{- if and .Values.config_local.enabled (empty .Values.config_local.existingSecret) }} From 1f8a0755354884520e750f202fc75d385b33a403 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Wed, 19 Aug 2026 11:32:24 +0100 Subject: [PATCH 2/3] fix: place CONCURRENTLY correctly in generated REINDEX SQL (#10251) CONCURRENTLY was being appended to the parenthesised option list alongside VERBOSE etc., which PostgreSQL rejects. It's not a parenthesizable option: it belongs standalone, between the object type keyword and the object name. --- .../tools/maintenance/templates/maintenance/sql/command.sql | 5 ++--- .../tests/test_maintenance_create_job_unit_test.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/web/pgadmin/tools/maintenance/templates/maintenance/sql/command.sql b/web/pgadmin/tools/maintenance/templates/maintenance/sql/command.sql index 32abb115f71..35312924227 100644 --- a/web/pgadmin/tools/maintenance/templates/maintenance/sql/command.sql +++ b/web/pgadmin/tools/maintenance/templates/maintenance/sql/command.sql @@ -14,7 +14,6 @@ {% if data.vacuum_parallel %}{{ maintenance_options.append('PARALLEL ' + data.vacuum_parallel) or "" }}{% endif %} {% if data.buffer_usage_limit %}{{ maintenance_options.append('BUFFER_USAGE_LIMIT "' + data.buffer_usage_limit + '"') or "" }}{% endif %} {% if data.reindex_tablespace %}{{ maintenance_options.append('TABLESPACE ' + conn|qtIdent(data.reindex_tablespace)) or "" }}{% endif %} -{% if data.reindex_concurrently %}{{ maintenance_options.append('CONCURRENTLY') or "" }}{% endif %} {% if data.op == "VACUUM" %} VACUUM{% for option in maintenance_options %}{% if loop.first %} ({% endif %}{{ option }}{% if not loop.last %}, {% endif %}{% if loop.last %}){% endif %}{% endfor %}{% if data.schema %} {{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.table) }}{% endif %}; {% endif %} @@ -23,9 +22,9 @@ ANALYZE{% for option in maintenance_options %}{% if loop.first %} ({% endif %}{{ {% endif %} {% if data.op == "REINDEX" %} {% if index_name %} -REINDEX{% for option in maintenance_options %}{% if loop.first %} ({% endif %}{{ option }}{% if not loop.last %}, {% endif %}{% if loop.last %}){% endif %}{% endfor %} INDEX {{ conn|qtIdent(data.schema, index_name) }}; +REINDEX{% for option in maintenance_options %}{% if loop.first %} ({% endif %}{{ option }}{% if not loop.last %}, {% endif %}{% if loop.last %}){% endif %}{% endfor %} INDEX{% if data.reindex_concurrently %} CONCURRENTLY{% endif %} {{ conn|qtIdent(data.schema, index_name) }}; {% else %} -REINDEX{% for option in maintenance_options %}{% if loop.first %} ({% endif %}{{ option }}{% if not loop.last %}, {% endif %}{% if loop.last %}){% endif %}{% endfor %}{% if not data.schema and not data.reindex_system %} DATABASE {{ conn|qtIdent(data.database) }}{% elif not data.schema and data.reindex_system%} SYSTEM {{ conn|qtIdent(data.database) }}{% elif data.schema and not data.table and not data.primary_key and not data.unique_constraint and not data.index and not data.mview %} SCHEMA {{ conn|qtIdent(data.schema) }}{% else %} TABLE {{ conn|qtIdent(data.schema, data.table) }}{% endif %}; +REINDEX{% for option in maintenance_options %}{% if loop.first %} ({% endif %}{{ option }}{% if not loop.last %}, {% endif %}{% if loop.last %}){% endif %}{% endfor %}{% if not data.schema and not data.reindex_system %} DATABASE{% if data.reindex_concurrently %} CONCURRENTLY{% endif %} {{ conn|qtIdent(data.database) }}{% elif not data.schema and data.reindex_system%} SYSTEM {{ conn|qtIdent(data.database) }}{% elif data.schema and not data.table and not data.primary_key and not data.unique_constraint and not data.index and not data.mview %} SCHEMA{% if data.reindex_concurrently %} CONCURRENTLY{% endif %} {{ conn|qtIdent(data.schema) }}{% else %} TABLE{% if data.reindex_concurrently %} CONCURRENTLY{% endif %} {{ conn|qtIdent(data.schema, data.table) }}{% endif %}; {% endif %} {% endif %} {% if data.op == "CLUSTER" %} diff --git a/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py b/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py index 0b6f265b9ee..54fdfebc670 100644 --- a/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py +++ b/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py @@ -537,7 +537,7 @@ class MaintenanceCreateJobTest(BaseTestGenerator): verbose=True ), url=MAINTENANCE_URL, - expected_cmd_opts=['REINDEX (VERBOSE, CONCURRENTLY) DATABASE ' + expected_cmd_opts=['REINDEX (VERBOSE) DATABASE CONCURRENTLY ' 'postgres;\n'], server_min_version=120000, message='REINDEX CONCURRENTLY is not supported by EPAS/PG server ' @@ -643,7 +643,7 @@ class MaintenanceCreateJobTest(BaseTestGenerator): verbose=True ), url=MAINTENANCE_URL, - expected_cmd_opts=['REINDEX (VERBOSE, CONCURRENTLY) TABLE ' + expected_cmd_opts=['REINDEX (VERBOSE) TABLE CONCURRENTLY ' 'my_schema.my_table;\n'], server_min_version=120000, message='REINDEX CONCURRENTLY TABLE is not supported by ' @@ -710,7 +710,7 @@ class MaintenanceCreateJobTest(BaseTestGenerator): verbose=True ), url=MAINTENANCE_URL, - expected_cmd_opts=['REINDEX (VERBOSE, CONCURRENTLY) INDEX ' + expected_cmd_opts=['REINDEX (VERBOSE) INDEX CONCURRENTLY ' 'my_schema.my_index;\n'], server_min_version=120000, message='REINDEX CONCURRENTLY is not supported by EPAS/PG server ' From c72c3d8b3b23cdedf38ba37c30227b7be1ecaa5c Mon Sep 17 00:00:00 2001 From: Dave Page Date: Thu, 20 Aug 2026 09:10:34 +0100 Subject: [PATCH 3/3] test: cover REINDEX SCHEMA CONCURRENTLY in maintenance job generation Add a regression case for reindex_concurrently=True combined with a schema target, asserting REINDEX (VERBOSE) SCHEMA CONCURRENTLY my_schema;. The command.sql template already places CONCURRENTLY correctly for this case; only test coverage was missing. --- .../test_maintenance_create_job_unit_test.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py b/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py index 54fdfebc670..0b7241e3634 100644 --- a/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py +++ b/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py @@ -606,6 +606,29 @@ class MaintenanceCreateJobTest(BaseTestGenerator): url=MAINTENANCE_URL, expected_cmd_opts=['REINDEX (VERBOSE) SCHEMA my_schema;\n'], )), + ('When maintenance the object with the REINDEX CONCURRENTLY SCHEMA', + dict( + class_params=dict( + sid=1, + name='test_maintenance_server', + port=5444, + host='localhost', + username='postgres' + ), + params=dict( + database='postgres', + schema='my_schema', + op='REINDEX', + reindex_concurrently=True, + verbose=True + ), + url=MAINTENANCE_URL, + expected_cmd_opts=['REINDEX (VERBOSE) SCHEMA CONCURRENTLY ' + 'my_schema;\n'], + server_min_version=120000, + message='REINDEX CONCURRENTLY SCHEMA is not supported by ' + 'EPAS/PG server less than 12.0' + )), ('When maintenance the object with the REINDEX TABLE', dict( class_params=dict(