---
title: "import a PostgreSQL database from source to target via pg_dump"
method: POST
path: "/w/{workspace}/workspaces/import_pg_database"
tags: ["workspace"]
---

# import a PostgreSQL database from source to target via pg_dump

`POST /w/{workspace}/workspaces/import_pg_database`

## Path parameters

- `workspace` string, required

## Request body

- object
  - `source` string, required — Source database: 'datatable://name' or '$res:path'
  - `target` string, required — Target database: 'datatable://name' or '$res:path'
  - `target_dbname_override` string — Override the target database name
  - `fork_behavior` 'schema_only' | 'schema_and_data' | 'keep_original', required

## Response `200`

status

---

[API](https://skmtc.dev/windmill/apis/windmill-api.md) · [All operations](https://skmtc.dev/windmill/apis/windmill-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/windmill/windmill-api/revisions/7b281701c340/schema)
