I am generating a dump file from a PostgreSQL database inside a Docker container which I want to be placed into the /tmp folder.
After opening a shell inside the Docker container, I then ran these commands:
sh-4.2# su - postgres
Last login: Wed Apr 18 05:22:26 UTC 2018 on pts/1
-bash-4.2$ psql
psql (9.3.15)
Type "help" for help.
I then executed this command to generate a dump file inside the /tmp folder:
postgres=# \! pg_dump -U user hidb -f /tmp/my_db_dumpa.sql;
Password: 
I gave the correct password when requested but there is no physical file inside /tmp folder in the host environment (Ubuntu Linux). Thanks

psqljust to use a shell escape to launch a command?