diff --git a/sites/platform/src/add-services/postgresql.md b/sites/platform/src/add-services/postgresql.md index 2895aed574..d43dbff408 100644 --- a/sites/platform/src/add-services/postgresql.md +++ b/sites/platform/src/add-services/postgresql.md @@ -264,6 +264,12 @@ You can use the `--stdout` option to pipe the result to another command. For exa {{% vendor/cli %}} db:dump --stdout | bzip2 > dump.sql.bz2 ``` +It is also possible to generate the dump locally if you have the `pg_dump` command installed with `{{% vendor/cli %}} tunnel:single`. The command will first ask for the service and then will provide a prompt for the URI string that you can use. For example: + +```bash +pg_dump -d postgresql://REPLACE_URI_FROM_OUTPUT -f dump.sql +``` + ## Importing data Make sure that the imported file contains objects with cleared ownership and `IF EXISTS` clauses. For example, you can create a DB dump with following parameters: diff --git a/sites/upsun/src/add-services/postgresql.md b/sites/upsun/src/add-services/postgresql.md index 1e0c40808e..54e8008b8c 100644 --- a/sites/upsun/src/add-services/postgresql.md +++ b/sites/upsun/src/add-services/postgresql.md @@ -298,6 +298,12 @@ You can use the `--stdout` option to pipe the result to another command. For exa {{% vendor/cli %}} db:dump --stdout | bzip2 > dump.sql.bz2 ``` +It is also possible to generate the dump locally if you have the `pg_dump` command installed with `{{% vendor/cli %}} tunnel:single`. The command will first ask for the service and then will provide a prompt for the URI string that you can use. For example: + +```bash +pg_dump -d postgresql://REPLACE_URI_FROM_OUTPUT -f dump.sql +``` + ## Importing data Make sure that the imported file contains objects with cleared ownership and `IF EXISTS` clauses. For example, you can create a DB dump with following parameters: