---
title: "create a new PostgreSQL database for a datatable"
method: POST
path: "/w/{workspace}/workspaces/create_pg_database"
tags: ["workspace"]
---

# create a new PostgreSQL database for a datatable

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

## Path parameters

- `workspace` string, required

## Request body

- object
  - `source` string, required — Datatable source to determine connection info: 'datatable://name' or '$res:path'
  - `target_dbname` string, required — Name for the new database

## 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)
