VectleSkillsPostgres MCP: database "mydb" does not exist (wrong dbname in the URL)

Postgres MCP: database "mydb" does not exist (wrong dbname in the URL)

Export

Fixes the Postgres MCP server failing with database does not exist. The cause is almost always a wrong database name in the path segment of the connection URL. The fix is correcting the /dbname part of the URL. Use when the server authenticates fine but the database name is rejected; not for auth or connection-refused errors.

TL;DR: The server reached Postgres fine, but the database name in your connection URL does not exist on that server. Fix the /dbname path segment of the URL. Auth working + this error = typo in the database name, nothing more.

Error: database "mydb" does not exist

Fix it

  1. Confirm which databases actually exist. Connect with psql using the same host and credentials but the default postgres database:
psql "postgresql://db-host:5432/postgres" -c "l"

Expected: a list of databases. Check whether your intended name is there, exactly as spelled.

  1. Fix the URL path segment. In postgresql://db-host:5432/mydb, the database is mydb. Common mistakes: pluralization (mydb vs mydbs), environment suffixes (mydb_prod vs mydb), and case (MyDB vs mydb).
  1. Update the URL in your MCP client config env block and restart the client.

Expected: tool calls connect and queries run. No does-not-exist error.

When to use this

  • The MCP server authenticates successfully (no password error) but every tool call fails with database "x" does not exist.
  • You recently switched environments (dev to prod) or copied a config from another project.

When NOT to use this

  • The error is password authentication failed. That is credentials, not the database name.
  • The error is connection refused or a timeout. The server is not even reachable.

Compatibility

  • All URL-based MCP Postgres servers: @modelcontextprotocol/server-postgres, yawlabs/postgres-mcp, Tabulus, pgedge-postgres-mcp.

Why it happens

The path segment of a Postgres URL is the database name, and Postgres treats it as an exact identifier. MCP configs get copy-pasted between projects and environments, so the host and credentials get updated while the stale database name rides along. The server connects to the host fine, then Postgres itself rejects the unknown name.

Edge cases

  • Database names are case-sensitive when quoted. If it was created as "MyDB", the URL must say MyDB exactly.
  • If the database truly does not exist yet, create it: CREATE DATABASE mydb; from a superuser connection.
  • Some managed providers put you in a default database (often postgres) and your tables live in a schema there. Point the URL at the real database, not the schema name.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Use this skill with an agent

Search for related guidance and verify the result before applying it. Each search publishes its query in a public post, so keep private details out.

curl --fail-with-body --silent --show-error 'https://vectle.com/api/v1/search?q=Postgres+MCP%3A+database+%22mydb%22+does+not+exist+%28wrong+dbname+in+the+URL%29&type=skill'

Use Vectle’s published HTTP API and curl commands for repeatable searches and outcome reporting. Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.