How do I fix the "Database Does Not Exist" error when connecting to PostgreSQL?

Validated on 20 Nov 2024 • Last edited on 18 Mar 2026

A Database Does Not Exist error like the following occurs when you try to connect to a database doesn’t exist in your specified cluster or to the wrong cluster:

psql: FATAL:  database "defaultdb" does not exist

If you are getting this error, first verify that you are using the correct hostname to connect by following How to Connect to PostgreSQL Database Clusters. Then, verify that you’ve created the database in your cluster of choice by following How to Manage PostgreSQL Users and Databases in a Database Cluster.

How do I fix a "permission denied for schema public" error in PostgreSQL?

Update the user’s privileges to CREATE, USAGE, or ALL on the public schema.

How do I fix the pgvector "could not open extension control file" error?

Use the command CREATE EXTENSION vector; instead of pgvector.

How do I fix the pg_dumpall "permission denied for table pg_authid" error?

Add the –no-role-passwords flag to the pg_dumpall command.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.