Postgresql error database does not exist however it exists when listing the databases

470 Views Asked by At

When I drop the database I have an error that it doesn't exist however when I list the databases I can see it. Here are the steps I am following:

  • sudo -u postgres psql
  • postgres=# \l
  • postgres=# DROP DATABASE IF EXISTS mydbname;

NOTICE: database "mydbname" does not exist, skipping DROP DATABASE

                                    List of databases
        Name        |     Owner     | Encoding | Collate |  Ctype  |     Access privileges
--------------------+---------------+----------+---------+---------+----------------------------
 mydbname           | postgres      | UTF8     | C.UTF-8 | C.UTF-8 | =Tc/postgres              +
                    |               |          |         |         | postgres=CTc/postgres     +
                    |               |          |         |         | cryptouser=CTc/postgres

0

There are 0 best solutions below