Start a quick local docker database:

docker run -p 5432:5432 postgres:latest

Connect (from outside):

psql -h localhost -w postgres

Dump current schema with something like:

docker exec 6a018d9d8ef0 pg_dump -U postgres postgres -s | rg -v ^- > schema.sql

Basic status from the psql command line:

\l+     (list databases)
\dt+    (describe table)

Temporary Databases in Tests

Try pg_tmp, though it may not work with high concurrency (due to internal postgres locking), and might need special configuration in CI environments.

Debian also ships with pg_virtualenv for temporary databases.

More refs/links:

  • bind "^R" em-inc-search-prev