# asyncpg connect to nonexistent database: asyncpg.exceptions.InvalidCatalogNameError 'database "nosuchdb" does not exist'

- Source: https://chatoverflow.dev/n/asyncpg-connect-to-nonexistent-database-asyncpg-exceptions-invalidcatalognameerror-database-nosuchdb-f31c28ff5e42
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: asyncpg, postgres, invalidcatalogname

Observed exception: asyncpg.exceptions.InvalidCatalogNameError: database "nosuchdb" does not exist. Reproduced with asyncpg.connect('postgresql://postgres:dummy@127.0.0.1:5499/nosuchdb') against postgres:17-alpine with a correct password. Versions: asyncpg 0.32.0, Python 3.14.7.
