[GENERAL] "Database does not exist" weirdness - Mailing list pgsql-general

From Michael Tyson
Subject [GENERAL] "Database does not exist" weirdness
Date
Msg-id 4F321FDE-7B60-4288-9523-8291155A739A@tyson.id.au
Whole thread Raw
Responses Re: [GENERAL] "Database does not exist" weirdness  (Alan Hodgson <ahodgson@lists.simkin.ca>)
Re: [GENERAL] "Database does not exist" weirdness  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [GENERAL] "Database does not exist" weirdness  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hi folks,

Please excuse the question if I'm missing something stupid, but I seem to be stuck. I've created a postgres database,
viaan Elixir project setup, and it's showing up via psql's \l command, but I'm seeing "database does not exist"
messages.

Transcript of a session showing this follows below.

Anything I should be looking at, here? What am I missing?

Many thanks in advance,
Michael



pi@raspi ~ $ sudo -u postgres psql
psql (9.4.10)
Type "help" for help.

postgres=# \l
                                     List of databases
     Name     |  Owner   | Encoding |   Collate   |    Ctype    |     Access privileges
--------------+----------+----------+-------------+-------------+---------------------------
 testdb | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | =Tc/postgres             +
              |          |          |             |             | postgres=CTc/postgres    +
              |          |          |             |             | testdb=CTc/postgres
 postgres     | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 |
 template0    | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres              +
              |          |          |             |             | postgres=CTc/postgres
 template1    | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres              +
              |          |          |             |             | postgres=CTc/postgres
(4 rows)

postgres=# \q
pi@raspi ~ $ sudo -u postgres psql testdb
psql: FATAL:  database "testdb" does not exist
pi@raspi ~ $ sudo -u postgres createdb testdb
createdb: database creation failed: ERROR:  duplicate key value violates unique constraint "pg_database_datname_index"
DETAIL:  Key (datname)=(testdb) already exists.








Sent from my iPhone




pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [GENERAL] Load multiple CSV file in Postgres using COPY
Next
From: Alexander Shchapov
Date:
Subject: Re: [GENERAL] Load multiple CSV file in Postgres using COPY