Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
0
votes
0
answers
9
views
pgAdmin4 Web - Query Tool Frozen/Blank
**Problem:** I've installed the latest web version of pgAdmin4: `9.6`, using the official pgAdmin Docker image: `dpage/pgadmin4`, and all seems to be working fine, except the main tool: "query tool", when I click on "query tool" icon, it just keeps opening blank tabs. (can't even close them) **Tried...
**Problem:**
I've installed the latest web version of pgAdmin4:
9.6
, using the official pgAdmin Docker image: dpage/pgadmin4
, and all seems to be working fine, except the main tool: "query tool", when I click on "query tool" icon, it just keeps opening blank tabs. (can't even close them)
**Tried:**
- logging off
- restarting image
- resetting layout
- reinstalling 9.6
- trying with 9.5
- trying with 9.1
**Notes:**
- I've tested the DB and connection string of the same DB on my Desktop
version of pgAdmin(also 9.6) and everything works, including "query
tool" (so the DB and connection string are fine...have only issues
with this docker web versions)

D4LI3N
(101 rep)
Aug 4, 2025, 05:36 AM
0
votes
1
answers
54
views
How do you add server connections on ubuntu version of pgAdmin?
I was sitting on pg14 for some time, while the postgresql package updates accumulated all the way up to 17, so the result of `pg_lsclusters` looks like this: ```shell Ver Cluster Port Status Owner Data directory Log file 14 main 5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/po...
I was sitting on pg14 for some time, while the postgresql package updates accumulated all the way up to 17, so the result of
The thing tripping me up is I think I had a setup step a while ago where I created a copy of
But now I need to actually migrate my database to the newest version and thus the problem at hand. Versions: - postgreSQL -
This does confirm that I in fact changed the password for
It still begs the question what IS the proper way of handling default
pg_lsclusters
looks like this:
Ver Cluster Port Status Owner Data directory Log file
14 main 5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
15 main 5433 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log
16 main 5434 online postgres /var/lib/postgresql/16/main /var/log/postgresql/postgresql-16-main.log
17 main 5435 online postgres /var/lib/postgresql/17/main /var/log/postgresql/postgresql-17-main.log
I only have a connection to version 14 in my pgAdmin panel, but how do I add connections for other servers? They require the password for postgres
which I either don't know or don't remember.The thing tripping me up is I think I had a setup step a while ago where I created a copy of
postgres
user with the same name as the admin account in the OS, or the package created it for me on install. Thus I've used that admin role in place of postgres
for superuser needs and forgot about original superuser. Possibly I've set a password for postgres
(most likely generated one) within old version of pgAdmin, saved it and completely forgot about it afterwards.But now I need to actually migrate my database to the newest version and thus the problem at hand. Versions: - postgreSQL -
17.4
- pgAdmin - 9.1
- Ubuntu - 22.04.5 LTS
**EDIT**: I can "enter" into the other cluster with sudo --user=postgres psql --port=5435
(without a password), but not when calling it with TCP/IP socket sudo --user=postgres psql --host=localhost --port=5435
. However sudo --user=postgres psql --host=localhost
, which enters into 5432
server, does ask for password, which matches password of the OS admin account.This does confirm that I in fact changed the password for
postgres
db user of 5432
server in order to create a connection in pgAdmin, and other clusters were created by the package updates according to their mystical rules.It still begs the question what IS the proper way of handling default
postgres
user for pgadmin connection while also preserving linux way of handling it as an OS user? Because now I think setting a password for it to connect was not a right call.
Biller Builder
(288 rep)
Jun 5, 2025, 11:01 AM
• Last activity: Jun 26, 2025, 06:58 PM
22
votes
3
answers
31516
views
Is there a way to access temporary tables of other sessions in postgres?
I'm working with a Windows application that uses a (local) postgres Database and stores some information in a temporary table. I'd like to have a look at the temporary table, but pgadmin and dbVis tell me: `ERROR: cannot access temporary tables of other sessions` when trying to query the data. I tri...
I'm working with a Windows application that uses a (local) postgres Database and stores some information in a temporary table. I'd like to have a look at the temporary table, but pgadmin and dbVis tell me:
ERROR: cannot access temporary tables of other sessions
when trying to query the data. I tried changing the permissions of the schema and table, but this didn't seem to help, even though I'm accessing the database with the same user as the program itself (at least in dbVis). Is there a setting I can change in my database that allows me to have "root" access to all session in my database?
newenglander
(1075 rep)
Aug 31, 2011, 09:10 AM
• Last activity: Jun 25, 2025, 02:04 PM
0
votes
1
answers
214
views
pgAdmin 4 Database lost after filed start-up - how do I recover the connection?
After a few months away from pgAdmin 4, I attempted to open the program - first time, it failed, second time it started up - but the database, called 'athome4' was missing. [![pgadmin 4 grab][1]][1] I checked in QGIS and the database and files still exist. [![enter image description here][2]][2] So...
After a few months away from pgAdmin 4, I attempted to open the program - first time, it failed, second time it started up - but the database, called 'athome4' was missing.
I checked in QGIS and the database and files still exist.
So I would like to know how I can recover the connection to pgAdmin 4 so I can work with this database again.
I simple step by step explanation would be best.
I am very concerned that if I start work on a new project that this may happen again.


Anthony Avengerland
(1 rep)
May 9, 2023, 12:06 AM
• Last activity: Jun 17, 2025, 08:05 AM
0
votes
1
answers
562
views
Binary path in pgadmin
I am running pgadmin via Docker desktop. I am unable to restore a sql file in the database. I get the following message - "Please configure the PostgreSQL Binary Path in the Preferences dialog." In the case of PostgreSQL installed in the device, I am aware about assigning the binary path. However in...
I am running pgadmin via Docker desktop. I am unable to restore a sql file in the database. I get the following message - "Please configure the PostgreSQL Binary Path in the Preferences dialog."
In the case of PostgreSQL installed in the device, I am aware about assigning the binary path. However in this case, pgadmin is accessed via docker.
how can I resolve this issue?
Rambo John
(1 rep)
Aug 1, 2023, 02:14 PM
• Last activity: May 31, 2025, 09:03 PM
2
votes
0
answers
22
views
Programmatically create a Role with Permissions within pgAdmin’s internal user management
I am asking about [*pgAdmin*][1] internal [user management][2], not *Postgres* users-and-roles. For teaching a beginning database class, I am trying to procedurally configure *pgAdmin* in Server Mode, using shell scripts, *Podman*, etc. In addition to the `Administrator` and `User` roles, I want to...
I am asking about *pgAdmin* internal user management , not *Postgres* users-and-roles.
For teaching a beginning database class, I am trying to procedurally configure *pgAdmin* in Server Mode, using shell scripts, *Podman*, etc. In addition to the
I want to procedurally create a Role that effectively has some of those checkboxes unchecked.
Administrator
and User
roles, I want to create a Student
role with restricted permissions.
The setup.py
feature offers a command-line interface for configuring pgAdmin. It offers commands like:
- add_user
- get_role
👉🏽 Is there some procedural way to define a Role with Permissions?
I need a console command equivalent for the *Permissions* tab in the *pgAdmin* GUI:

Basil Bourque
(11188 rep)
May 16, 2025, 06:07 AM
• Last activity: May 17, 2025, 03:37 AM
1
votes
1
answers
170
views
Running Postgres on windows AND WSL, connect pgadmin to both
I have a webapp I'm developing using Symfony 6.4 and Postgres 15. My Employer has given me a windows machine that is locked down and I can not get raised privileges. Anytime i want anything done i have to go through service desk. I have noticed that my PHP/Symfony app runs poorly compared to another...
I have a webapp I'm developing using Symfony 6.4 and Postgres 15.
My Employer has given me a windows machine that is locked down and I can not get raised privileges. Anytime i want anything done i have to go through service desk.
I have noticed that my PHP/Symfony app runs poorly compared to another (contract) developer who uses a linux distribution - so i figured I would set up WSL2 with ubuntu and try a full app set up there to see if there is a performance issue.
I would really like my WSL Postgres AND my Windows Postgres to be accessible in pgAdmin4. I need them both for now while I complete this investigation. Without the admin privileges I cannot stop the windows PostgreSQL service.
Has anybody achieved this, or knows how to achieve this?
* I have the postgres installed on WSL2 Ubuntu
* I have opened the conf file and set
listen_addresses = 'localhost'
* I have also tried 127.0.0.1
* I have tried setting the port on ubuntu to 5431 (instead of 2)
Results:


mrpeebs
(21 rep)
Apr 7, 2025, 10:02 AM
• Last activity: May 16, 2025, 12:01 PM
39
votes
8
answers
70575
views
save/export PGAdmin server list configuration settings
I have a ton of configured connections listed in the Server Groups, is there a way I can save this? not just save the passwords but the Server Group Settings ![enter image description here][1] [1]: https://i.sstatic.net/LICMS.png
I have a ton of configured connections listed in the Server Groups, is there a way I can save this? not just save the passwords but the Server Group Settings

Phill Pafford
(1415 rep)
Nov 20, 2013, 03:33 PM
• Last activity: Apr 17, 2025, 02:35 PM
3
votes
2
answers
2775
views
Can I have two Query Editor panels in pgAdmin?
Can I have two different Query Editor panels in PGAdmin, side by side? If not, is there another way of avoiding the pain point that's making me want two panels? That is: When I'm building up a complex query, there's so much back-and forth that using the Scratch panel to swap queries gets cumbersome....
Can I have two different Query Editor panels in PGAdmin, side by side?
If not, is there another way of avoiding the pain point that's making me want two panels? That is:
When I'm building up a complex query, there's so much back-and forth that using the Scratch panel to swap queries gets cumbersome. It's like:
* Start with a basic query.
* Test run it.
* Add a where clause
* Cut-paste the query to the scratch panel
* Run a little SELECT to find a valid value to test the new where clause with.
* Move the query back from the scratch panel, plug in the testing value, retest.
* Add a JOIN clause, retest
* Add a WHERE clause using the new join
* Again copy the query over to the scratch panel
* Run another little select line to find a valid value to plug into the WHERE for testing.
* Copy the query back from the scratch panel, plug in the new value, run the test again.
* Repeat this iteration cycle until the query is where it needs to be.
And the steps where I just move the query being built over to the scratch panel and back over and over and over feels like a distraction and needless busy work. If I could just have two Query Editor panes, and run my little SELECTs to find values in the second panel, there's be one less little chore dragging me out of flow state.
Is there some way of getting a second Query Editor panel in pgAdmin?
Or is there some alternate development habit I could be using so I wouldn't feel the need for one?
baudot
(245 rep)
Mar 16, 2022, 10:28 AM
• Last activity: Apr 11, 2025, 07:00 PM
34
votes
4
answers
31455
views
Retrieving all PK and FK
I have a big database that I need to extract all primary keys and foreign keys from each table. I have pgAdmin III. Is there a way to do this automatically and not go over each table manually?
I have a big database that I need to extract all primary keys and foreign keys from each table.
I have pgAdmin III.
Is there a way to do this automatically and not go over each table manually?
Nick Ginanto
(1009 rep)
Mar 19, 2013, 07:24 AM
• Last activity: Apr 3, 2025, 10:15 PM
1
votes
1
answers
751
views
postgresql statement taking ages to cancel in pgAdmin III
I was running a query in pgAdmin III and it was taking a long time. After 9 minutes I decided to cancel it using the stop button. The UI stated that it was cancelling and stayed in that state for slightly over an hour before it reported as cancelled. For all that time the CPU was around 98-99%. The...
I was running a query in pgAdmin III and it was taking a long time. After 9 minutes I decided to cancel it using the stop button. The UI stated that it was cancelling and stayed in that state for slightly over an hour before it reported as cancelled. For all that time the CPU was around 98-99%.
The statement that was running was a call to a function. It was only part way through the function when it got stuck and all the time was taken on the following statement:
SELECT ST_UNION(shape)
FROM descendant_areas
INTO best_fit_areas;
where descendant_areas is a temporary table with no indexes containing nine records. Shape is of type
geography
.
Versions:
PostgreSQL=PostgreSQL 9.5.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16), 64-bit
PostGIS=POSTGIS="2.2.2 r14797" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 2.0.2, released 2016/01/26" LIBXML="2.9.1" LIBJSON="0.12" TOPOLOGY RASTER
My question is:
Is it normal for cancelling a query to take that long or is it indicative that there are config settings set up badly?
Andy Nichols
(111 rep)
Jul 1, 2016, 11:21 AM
• Last activity: Feb 17, 2025, 03:06 AM
58
votes
2
answers
69883
views
pgAdmin: What is the Maintenance DB?
pgAdmin's *Register - Server* dialog for adding new database connections asks for a **"Maintenance database"**. In order to be able to connect, I set it to the database I want to connect (and also, I have the rights to connect). So, why is that field named "Maintenance DB" instead of just "DB" or "D...
pgAdmin's *Register - Server* dialog for adding new database connections asks for a **"Maintenance database"**. In order to be able to connect, I set it to the database I want to connect (and also, I have the rights to connect).
So, why is that field named "Maintenance DB" instead of just "DB" or "Database"?
jgomo3
(714 rep)
Jun 11, 2014, 09:04 PM
• Last activity: Feb 16, 2025, 12:31 PM
6
votes
5
answers
36436
views
How to fix "your account is locked. please contact admin" error in pgAdmin?
I'm new to PostgreSQL.I'm using postgreSQL locally. I used it last time without any issues. Now, when I try login with my login credentials it shows the account is locked message all the time. [![enter image description here][1]][1] [1]: https://i.sstatic.net/6FgqB.png
I'm new to PostgreSQL.I'm using postgreSQL locally. I used it last time without any issues. Now, when I try login with my login credentials it shows the account is locked message all the time.

gowtham6672
Sep 4, 2021, 02:38 PM
• Last activity: Feb 6, 2025, 09:11 AM
13
votes
2
answers
26711
views
PostgreSQL, display role members
Is there a way to visualize which users are members of a role in PostgreSQL / pgAdminIII, like role: council_stuff members: Harry Ben Steve Melinda
Is there a way to visualize which users are members of a role in PostgreSQL / pgAdminIII, like
role: council_stuff
members:
Harry
Ben
Steve
Melinda
Jochen Schwarze
(327 rep)
Apr 28, 2016, 02:19 PM
• Last activity: Jan 3, 2025, 08:01 AM
1
votes
1
answers
132
views
Why listen_addresses not changing in PostgreSQL?
I'm trying to ENABLE remote client access on my PostgreSQL 12 database (Ubuntu 20.04 LTS). I've changed **```postgresql.conf```** on both paths ***/var/lib/postgresql/12/main*** and ***/etc/postgresql/12/main*** this way: listen_addresses = '*' Of course also add my ip in **```pg_hba.conf```** I've...
I'm trying to ENABLE remote client access on my PostgreSQL 12 database (Ubuntu 20.04 LTS).
I've changed **
.conf
** on both paths ***/var/lib/postgresql/12/main*** and ***/etc/postgresql/12/main*** this way:
listen_addresses = '*'
Of course also add my ip in **.conf
**
I've also tried:
root@localhost:/# sudo -u postgres psql
psql (12.20 (Ubuntu 12.20-0ubuntu0.20.04.1))
Type "help" for help.
postgres=# ALTER SYSTEM SET LISTEN_ADDRESSES='*';
ALTER SYSTEM
And after many restarts (of postgreSQL and even whole vnc) anyway I'm getting this:
root@localhost:/# sudo -u postgres psql -c 'SHOW listen_addresses;'
listen_addresses
------------------
localhost
(1 row)
And **pgAdmin 4** on my PC also tell me:
> Unable to connect to server: connection timeout expired
I even tried to reinstall postgreSQL - no effect 😭
Why so? What is wrong?
Colleagues, please give me an advice how to solve this problem?
**UPD:** Also tried with inactive firewall - no effect...
Aeverandi
(11 rep)
Oct 3, 2024, 02:13 PM
• Last activity: Dec 2, 2024, 01:48 PM
0
votes
1
answers
151
views
How to connect local pgadmin to a remote docker/postgres
Prostgres db is running in docker on a VPS (Ubuntu). docker ps 4f945e0bf0bc postgres "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp postgres-0 From a Windows PC, I want to connect to the database using pgadmin, but it's not successfull : `Unable to connect to...
Prostgres db is running in docker on a VPS (Ubuntu).
docker ps
4f945e0bf0bc postgres "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp postgres-0
From a Windows PC, I want to connect to the database using pgadmin, but it's not successfull :
Unable to connect to server: connection timeout expired
.
In the "Host name/address" field of pgadmin I've entered the IP address of the Ubuntu server.
See output of command "ip a"
What else do I need to configure so that pgadmin can access the DB ?


user2023141
(99 rep)
Nov 9, 2024, 02:11 PM
• Last activity: Nov 28, 2024, 02:46 PM
1
votes
0
answers
605
views
Unable to create and install pgAgent service
I'm trying to install pgAgent on my device. During the installation using the stackbuilder, the last step requires me to add the operating system username and password as below: [![last prompt window][1]][1] However, after entering the password of my postgres superuser account, i'm shown the below d...
I'm trying to install pgAgent on my device. During the installation using the stackbuilder, the last step requires me to add the operating system username and password as below:
However, after entering the password of my postgres superuser account, i'm shown the below dialog box:
Every resource available online mentions that the username and password should be the superuser's. I've tried using the Windows account details as well as creating a new user within postgres and using its details. Any help would be greatly appreciated. I'm using PostgreQL v13, and pgAgent v4.2.1


Abhinav Shenoy
(11 rep)
Jan 19, 2023, 09:52 AM
• Last activity: Sep 25, 2024, 10:19 AM
-1
votes
1
answers
30
views
How do I get PGAdmin to function properly
I am having trouble accessing the PGAdmin software. I get a fatal error message "The pgAdmin 4 server could not be contacted:"... what do I need to do to fix this?
I am having trouble accessing the PGAdmin software. I get a fatal error message "The pgAdmin 4 server could not be contacted:"... what do I need to do to fix this?
Adam A
(1 rep)
Sep 24, 2024, 10:30 PM
• Last activity: Sep 24, 2024, 11:50 PM
5
votes
1
answers
1648
views
In pgAdmin 4, show multiple lines of a TEXT column
A have a TEXT column in which the values contain newlines. When I query the column in pgAdmin, I only see the first line of each value. Can I make pgAdmin show multiple lines in a cell?
A have a TEXT column in which the values contain newlines. When I query the column in pgAdmin, I only see the first line of each value. Can I make pgAdmin show multiple lines in a cell?
Sam Kauffman
(151 rep)
Jun 11, 2018, 04:32 PM
• Last activity: Sep 5, 2024, 03:08 PM
0
votes
0
answers
145
views
How do I change the console font for psql in PostgreSQL 16.3?
I don't know how this has happened (I may have changed something in my PostgreSQL / psql settings) but now everytime I open the psql console I get the following error: "WARNING: Console code page (850) differs from Windows code page (1252) 8-bit characters might not work correctly. See psql referenc...
I don't know how this has happened (I may have changed something in my PostgreSQL / psql settings) but now everytime I open the psql console I get the following error:
"WARNING: Console code page (850) differs from Windows code page (1252) 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details."
I've ran the suggested fixes in this post (psql shell uses code page 850, windows uses 1252. How to solve change console code page?) but none of them have resolved it for me.
The official PostgreSQL documentation for the version I'm running (version 16.3) https://www.postgresql.org/docs/16/app-psql.html says to fix this I need to run the 'cmd.exe /c chcp 1252' command (as in the post above), and set the console font to Lucida Console.
How do I set the console font? I can't figure it out and I can't find any pages on the internet that provide a suitable answer for my version of Postgres, version 16.3. I'm on Windows 10.
I've looked in File > Preferences (in PGAdmin) but I can't find a setting for fonts.
Can someone help me please? I don't want to have to reinstall Postgres if I can avoid it.
I've ran the suggested fixes in this post (psql shell uses code page 850, windows uses 1252. How to solve change console code page?) but none of them have resolved it for me.
I've looked in File > Preferences (in PGAdmin) but I can't find a setting for fonts.

sekuoia
(1 rep)
Aug 21, 2024, 10:47 AM
Showing page 1 of 20 total questions