You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker pull dpage/pgadmin4
docker run -p 80:80 -e "[email protected]" -e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" --name pgadmin4 -d dpage/pgadmin4
# open http://localhost and login
Recipes
Backup / restore
Backup can be done with pgAdmin (personally I prefer plain format to have human readble sql content)
Restore can be done with Docker: cat D:\Temp\dump.sql | docker exec -i postgres966 psql -U postgres (you may have to add the missing roles entries, which are not exported such as CREATE ROLE mycompany SUPERUSER;)
Queries
SQL
Update a user password
ALTERUSER user WITH PASSWORD 'newpassword';
Get all databases
SELECT*FROMpg_catalog.pg_database;
Get all tables
SELECT
table_schema ||'.'|| table_name
FROMinformation_schema.tablesWHERE
table_type ='BASE TABLE'AND
table_schema NOT IN ('pg_catalog', 'information_schema');
SELECT*FROMpg_catalog.pg_tablesWHERE schemaname ='gracethd';