SQLSTATE 3D000Severity lowLab verified

Incident brief

Invalid catalog name

A connection attempt named a database that doesn't exist. PostgreSQL rejected the connection before it was ever established.

Reproduced on PostgreSQL 16.14Verified 2026-07-16 (Docker lab, PostgreSQL 16.14)Reviewed by Verified against PostgreSQL 16.14 in an isolated lab environment

In 10 seconds

What
Invalid catalog name
What triggers it
Try to connect to a database name that has never been created.
The fix
Connect using the correct, existing database name.
Proof
Reproduced on PostgreSQL 16.14 → Connecting to a database name that had never been created was rejected with SQLSTATE 3D000. The correct database name, tried right afterward, connected normally.

The fix

What to do right now

The immediate, application-level response to this error.

  • Connect using the correct, existing database name.
  • If the database genuinely should exist, create it first with CREATE DATABASE — but see the counterexample for why you can't do that inline as part of the same failed attempt.
  • Double-check for typos and case — PostgreSQL folds unquoted database names to lowercase, so case mismatches trigger this same SQLSTATE even for a database that does exist.
Fix — SQL
-- reconnect using the correct, existing database name
SELECT 1 AS connected_successfully;

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 16.14
Last verified
2026-07-16 (Docker lab, PostgreSQL 16.14)
Reviewed by
Verified against PostgreSQL 16.14 in an isolated lab environment
Audit status
reviewed