FATAL: no such database

From: BeeRich Lists <bee(dot)lists(at)gmail(dot)com>
To: Submit Postgresql Novice <pgsql-novice(at)postgresql(dot)org>
Subject: FATAL: no such database
Date: 2022-02-21 20:24:46
Message-ID: AB678941-ED2D-49BF-9EF5-919A2D8538F3@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-novice

For some reason I cannot create a database. I use Sequel, Postico, and psql, and all three won’t create a database. The first two write the syntax for me, and they too return errors. Here is an example in psql:

rich=# CREATE DATABASE alpha;
CREATE DATABASE
rich=# \c alpha;
FATAL: no such database: alpha
Previous connection kept
rich=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
alpha | rich | UTF8 | C | C |
postgres | rich | UTF8 | C | C |
rich | rich | UTF8 | C | C |
template0 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
template1 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
(5 rows)

rich=# DROP DATABASE alpha;
DROP DATABASE
rich=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
postgres | rich | UTF8 | C | C |
rich | rich | UTF8 | C | C |
template0 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
template1 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
(4 rows)

rich=# CREATE DATABASE alpha;
CREATE DATABASE
rich=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
alpha | rich | UTF8 | C | C |
postgres | rich | UTF8 | C | C |
rich | rich | UTF8 | C | C |
template0 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
template1 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
(5 rows)

rich=# \c alpha;
FATAL: no such database: alpha
Previous connection kept
rich=#

I have reinstalled PostgreSQL 12 both through homebrew as well as using the Postgres.app on MacOS. Both have the same issue.

Anybody have any insight into what I should try? Thanks for your time.

Cheers, Bee

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2022-02-21 20:43:58 Re: FATAL: no such database
Previous Message Jean Baro 2022-02-12 18:01:00 Re: Best practices for preparing an application to (possibly) be sharded (FDW) in the future?