Dump and Restore

# execute in pods
kubectl exec -it -n namespace postgres-547877b6b5-p4p95 -- /bin/bash

# dump
pg_dump -h localhost -U username dbname --schema-only > dump_schema_202206061134.sql

# copy to host
kubectl cp namespace/postgres-547877b6b5-p4p95:dump_schema_202206061134.sql ./dump_schema_202206061134.sql

# restore to a docker
docker cp  ./dump_schema_202206061134.sql pg-container:dump_schema_202206061134.sql
docker exec -it pg-container 'psql -U postgres epidemic_prevention < dump_schema_202206061134.sql'