"psql -h pg.neon.tech" fails if I delete the "main" database

$ psql -h pg.neon.tech

NOTICE: Welcome to Neon!
Authenticate by visiting:
https:// console.neon.tech/psql_session/xxxxxxxxx

NOTICE: Connecting to database.
psql: error: connection to server at “pg.neon.tech” (, port 5432 failed: ERROR: database “main” does not exist

works again after I recreated a database called “main”

no blocker but worth noting!

Thank you for reporting! I can reproduce this, will look into fixing this.

I’m also curious about what lead you do dropping the main database. Did you simply want to play and see how things work, was your goal to rename the database, or something else? Is there a particular naming convention for choosing the name for the database that you prefer?

Thank you,

I was creating a fresh setup from scratch to match my current dev/prod conventions.

I have been using database names like db-core-dev-eu(following the template db-{service}-{environment}-{region}) - to place this contextual information in the database name, rather than just have this in the project name (== server/host in traditional non-serverless postgres). There may be better ways - but this was how I ended up here!

(To repeat - not a blocker as the workaround is simply to ensure an empty database named main is present - just slightly bumpy developer experience)


1 Like