1

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

Menna Magdy
  • 355
  • 1
  • 2
  • 14
  • I found the solution in this question https://stackoverflow.com/questions/53471160/error-database-is-being-accessed-by-other-users-detail-there-are-24-other-sess – Menna Magdy Mar 29 '22 at 23:42
  • Does this answer your question? [ERROR: database is being accessed by other users DETAIL: There are 24 other sessions using the database](https://stackoverflow.com/questions/53471160/error-database-is-being-accessed-by-other-users-detail-there-are-24-other-sess) – Vivek S. Mar 30 '22 at 06:09
  • The linked question describes a completely different problem than "database does not exist" –  Mar 30 '22 at 06:53

0 Answers0