Skip to content

Commit f635df6

Browse files
authored
Added support for post-connection SQL execution, which will be run automatically on each connection made to any database of the server. #4503
1 parent b266993 commit f635df6

File tree

16 files changed

+91
-12
lines changed

16 files changed

+91
-12
lines changed
24.2 KB
Loading
-9.57 KB
Loading
-3.26 KB
Loading
-11.2 KB
Loading
66 KB
Loading
-7.68 KB
Loading

docs/en_US/images/server_tags.png

820 Bytes
Loading

docs/en_US/release_notes_9_2.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ New features
2121
************
2222

2323
| `Issue #4194 <https://github.com/pgadmin-org/pgadmin4/issues/4194>`_ - Added support to automatically open a file after it is downloaded in the desktop mode.
24+
| `Issue #4503 <https://github.com/pgadmin-org/pgadmin4/issues/4503>`_ - Added support for post-connection SQL execution, which will be run automatically on each connection made to any database of the server.
2425
| `Issue #5871 <https://github.com/pgadmin-org/pgadmin4/issues/5871>`_ - Add support for restoring plain SQL database dumps.
2526
| `Issue #8034 <https://github.com/pgadmin-org/pgadmin4/issues/8034>`_ - Added support for creating Directory nodes in EPAS.
2627
| `Issue #8449 <https://github.com/pgadmin-org/pgadmin4/issues/8449>`_ - Change icon buttons to show tooltip even when disabled.
@@ -34,6 +35,7 @@ Bug fixes
3435
*********
3536

3637
| `Issue #8006 <https://github.com/pgadmin-org/pgadmin4/issues/8006>`_ - Removed the pre-install script from the Red Hat build function as it was causing a No such file or directory warning during the update.
38+
| `Issue #8316 <https://github.com/pgadmin-org/pgadmin4/issues/8316>`_ - Ensure that modal dialogs are not triggered more than once to avoid duplicates.
3739
| `Issue #8355 <https://github.com/pgadmin-org/pgadmin4/issues/8355>`_ - Change session files garbage collection strategy.
3840
| `Issue #8437 <https://github.com/pgadmin-org/pgadmin4/issues/8437>`_ - Fixed an issue where the PSQL terminal displays keyname for non alphanumeric keys.
3941
| `Issue #8462 <https://github.com/pgadmin-org/pgadmin4/issues/8462>`_ - Fixed an issue where geometries in the geometry viewer will render partially when the container was resized.

docs/en_US/server_dialog.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ Use the fields in the *Advanced* tab to configure a connection:
225225

226226
.. note:: The Password exec option is only supported when pgAdmin is run in desktop mode.
227227

228-
* Click the *Save* button to save your work.
229-
* Click the *Close* button to exit without saving your work.
230-
* Click the *Reset* button to return the values specified on the Server dialog
231-
to their original condition.
228+
Click the *Post Connection SQL* tab to continue.
232229

233-
.. toctree::
230+
.. image:: images/server_post_connection_sql.png
231+
:alt: Server dialog post connection sql tab
232+
:align: center
234233

235-
clear_saved_passwords
234+
* Use the *Post Connection SQL* field to write the SQL queries that will be
235+
executed in autocommit mode for each connection made to any database on this server.
236236

237237

238238
Click the *Tags* tab to continue.
@@ -245,6 +245,15 @@ Use the table in the *Tags* tab to add tags. The tags will be shown on the right
245245
a server node label in the object explorer tree.
246246

247247
Click on the *+* button to add a new tag. Some of the parameters are:
248+
* *Text* field to specify the tag name.
249+
* *Color* field to select the accent color of the tag.
250+
251+
252+
* Click the *Save* button to save your work.
253+
* Click the *Close* button to exit without saving your work.
254+
* Click the *Reset* button to return the values specified on the Server dialog
255+
to their original condition.
256+
257+
.. toctree::
248258

249-
* *Text* field to specify the tag name.
250-
* *Color* field to select the accent color of the tag.
259+
clear_saved_passwords
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
##########################################################################
2+
#
3+
# pgAdmin 4 - PostgreSQL Tools
4+
#
5+
# Copyright (C) 2013 - 2025, The pgAdmin Development Team
6+
# This software is released under the PostgreSQL Licence
7+
#
8+
##########################################################################
9+
10+
"""
11+
12+
Revision ID: e982c040d9b5
13+
Revises: 255e2842e4d7
14+
Create Date: 2025-03-13 16:55:26.893395
15+
16+
"""
17+
from alembic import op
18+
import sqlalchemy as sa
19+
20+
# revision identifiers, used by Alembic.
21+
revision = 'e982c040d9b5'
22+
down_revision = '255e2842e4d7'
23+
branch_labels = None
24+
depends_on = None
25+
26+
27+
def upgrade():
28+
op.add_column('server', sa.Column('post_connection_sql', sa.String()))
29+
30+
31+
def downgrade():
32+
# pgAdmin only upgrades, downgrade not implemented.
33+
pass

0 commit comments

Comments
 (0)