---
title: "Select a database"
method: POST
path: "/api/databases/select"
tags: ["Databases"]
---

# Select a database

`POST /api/databases/select`

Switches the active database connection to the specified database name.

## Request body

- SelectDatabaseRequest — Request to select a database by name.
  - `name` string, required — The name of the database to select.

## Response `200`

Database selected successfully.

- SelectDatabaseResponse — Response after selecting a database.
  - `current` string, required — The name of the now-current database.
  - `error` string — An error message if the operation failed.
  - `message` string, required — A human-readable status message.
  - `success` boolean, required — Whether the database was selected successfully.

## Other responses

- `400` — Invalid request body.
- `401` — Missing or invalid authentication token.
- `403` — Insufficient permissions.
- `404` — Database not found.

---

[API](https://skmtc.dev/pgedge/apis/pgedge-postgres-mcp-server-api.md) · [All operations](https://skmtc.dev/pgedge/apis/pgedge-postgres-mcp-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pgedge/pgedge-postgres-mcp-server-api/revisions/6084bab46b1e/schema)
