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
ALTER USER user WITH PASSWORD 'newpassword';
Get all databases
SELECT * FROM pg_catalog.pg_database;
Get all tables
SELECT
table_schema || '.' || table_name
FROM
information_schema.tables
WHERE
table_type = 'BASE TABLE'
AND
table_schema NOT IN ('pg_catalog', 'information_schema');
SELECT * FROM pg_catalog.pg_tables WHERE schemaname = 'gracethd';
Get all columns of a table
SELECT *
FROM information_schema.columns
WHERE table_schema = 'gracethd'
AND table_name = 'adresse';