# postgres

Create and manage Prisma Postgres databases.

Use `postgres` commands to manage [Prisma Postgres](/guides/deploy-postgres) databases in a project. Most commands let you target a specific project with `--project <id-or-name>` and a branch with `--branch <git-name>`.

## Usage

:::code-group
```bash title="bun"
bunx prisma postgres list
bunx prisma postgres create mydb
```

```bash title="pnpm"
pnpm prisma postgres list
pnpm prisma postgres create mydb
```

```bash title="yarn"
yarn prisma postgres list
yarn prisma postgres create mydb
```

```bash title="npm"
npx prisma postgres list
npx prisma postgres create mydb
```
:::

## Commands

| Command                                      | Description                                                                                         |
| -------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `postgres list`                              | List databases                                                                                      |
| `postgres show <database>`                   | Show database metadata without secret values                                                        |
| `postgres create <name>`                     | Create a database and print its one-time connection URL. `--region` sets the Prisma Postgres region |
| `postgres usage <database>`                  | Show usage metrics for a database                                                                   |
| `postgres delete <database>`                 | Permanently delete a database, after exact id confirmation                                          |
| `postgres backup list <database>`            | List platform-created backups for a database                                                        |
| `postgres backup restore <database>`         | Restore from a backup, after exact id confirmation                                                  |
| `postgres connection list <database>`        | List a database's connections                                                                       |
| `postgres connection create <database>`      | Create a database connection and print its one-time connection URL                                  |
| `postgres connection rotate <connection-id>` | Rotate connection credentials and print the new one-time connection URL                             |
| `postgres connection delete <connection-id>` | Permanently delete a database connection, after exact id confirmation                               |

## Related pages

- [Authentication & Tools](./authentication-tools-index.md)
- [Build](./build-index.md)
- [Changelog](../changelog.md)
- [Concepts](./concepts-index.md)
- [Console commands](./console-commands-index.md)
- [Contract Authoring](./contract-authoring-index.md)
- [Core Concepts](./core-concepts-index.md)
- [Data Modeling](./data-modeling-index.md)
- [Database](./database-index.md)
- [DB commands](./db-commands-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
