- Start a new Postgres docker container (with or without mount Postgres data): ``` $ docker run --name pg1 -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres $ docker run --name pg1 -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d -v postgres-data:/var/lib/postgresql/data postgres ``` - Step into the Postgres database docker container: ``` $ docker run -it --rm postgres psql -h <host-ip-address> -U postgres ``` - Useful commands: ``` # List of relations postgres=# \dt List of relations Schema | Name | Type | Owner --------+----------------+-------+---------- public | dataset | table | postgres public | model | table | postgres public | net | table | postgres ... (10 rows) # List of table contents postgres=# select * from model; id | tag | framework | owner --------+---------------+------------+------- 5425d8 | tf-model-sept | tensorflow | kevin ... (21 rows) ``` - Create a new table: https://www.tutorialspoint.com/postgresql/postgresql_create_table.htm