Skip to content

Commit

Permalink
postgresql: add info about local pg_dump with tunnel (platformsh#4208)
Browse files Browse the repository at this point in the history
* postgresql: add info about local pg_dump with tunnel

* Update postgresql.md

Made edits to sentence :)

* Update postgresql.md

Made some edits to the sentence :)

---------

Co-authored-by: Kemi Elizabeth <[email protected]>
Co-authored-by: Chad Carlson <[email protected]>
  • Loading branch information
3 people authored Sep 27, 2024
1 parent b9f43b4 commit 8590e6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sites/platform/src/add-services/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions sites/upsun/src/add-services/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8590e6b

Please sign in to comment.