How to generate a Postgresql Dump from a Docker container?

前端 未结 5 569
忘掉有多难
忘掉有多难 2021-01-31 02:55

I would like to have a way to enter into the Postgresql container and get a data dump from it.

5条回答
  •  有刺的猬
    2021-01-31 03:26

    Use the following command from a UNIX terminal:

    docker exec  pg_dump  > backup
    

    The following command will dump only inserts from all tables:

    docker exec  pg_dump --column-inserts --data-only   > inserts.sql
    

提交回复
热议问题