-
get the container running on port 5000 NOTE: 5000:5432 => map from 5432 to 5000
docker run --name dev-postgres -e POSTGRES_PASSWORD=pwd -p 5000:5432 -d postgres
-
access shell for that container
docker exec -it dev-postgres bash
- enter the psql command line
psql -h localhost -U postgres
- list databses
\l
- connect to a db
\c <database_name> <optional: as_user>
example:\c database spring_auth
- list tables
\dt
- get schema of table, i.e descirbe
\d table_name
example:\d users
- create user
CREATE USER user_name WITH [OPTION];
[3]
For using extra types and general purpose utilities that are not supported by the Hibernate ORM core and optimiser for jpa and hibernate solutions can be found in resource #5
- https://chartio.com/resources/tutorials/how-to-list-databases-and-tables-in-postgresql-using-psql/
- https://www.postgresqltutorial.com/postgresql-describe-table/
- https://kb.objectrocket.com/postgresql/how-to-use-the-postgres-create-user-command-1449
- https://www.codementor.io/@engineerapart/getting-started-with-postgresql-on-mac-osx-are8jcopb
- https://github.com/vladmihalcea/hibernate-types
- https://medium.com/coding-blocks/creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e