pgadmin-org / pgadmin-org/pgadmin4
Execute the same SQL against multiple selected databases/connections
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 891
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 8
Description
Hi,
I'm frequently working with multiple PostgreSQL databases that have the same schema (multi-tenant environments, templete databases).
A common task is running the same maintenance or diagnostic SQL against several databases. At the moment I have to:
expand each database
open a Query Tool for each one
paste the same SQL
execute it separately
This becomes repetitive when working with several databases.
It would be very useful if the Query Tool could execute the current SQL against multiple selected databases/connections.
For example:
Execute → Execute on Multiple Databases...
Select one or more open connections/databases.
Run the SQL sequentially.
Show the result (or any error) for each database separately.
I'm not suggesting cross-database SQL execution inside PostgreSQL itself—just having pgAdmin send the same query to multiple selected connections one after another.
I know this can already be done using psql or custom scripts, but having it built into pgAdmin would make these routine tasks much more convenient.
This would make routine administration tasks much faster for environments with many similar databases.
Thanks for considering it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating pgAdmin's Query Tool and the existing connection or database selection flow. Define how selected databases are chosen, how SQL is executed sequentially, and how separate results and errors are presented; done means the same current SQL can run against multiple selected connections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- database, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100