-1

I have 5 databases which are shown below.

enter image description here

I am trying to drop test database by using "drop database test". But when i check list of databases than test database also shown in that list.

enter image description here

What should I do now? How i can resolve this issue?

  • What happens if you run the command with a semicolon at the end? i.e. `DROP DATABASE test;` ? – Dai Dec 26 '19 at 15:26
  • postgres=# drop database test; ERROR: database "test" is being accessed by other users DETAIL: There is 1 other session using the database. – Muhammad Imran Dec 26 '19 at 15:35

1 Answers1

1

Yeah you are missing the semi-colon. When psql changes from = to - in the prompt, it means you haven’t finished the query.

jens
  • 2,075
  • 10
  • 15
  • when i add semi-colon it give me error like this. postgres=# drop database test; ERROR: database "test" is being accessed by other users DETAIL: There is 1 other session using the database. – Muhammad Imran Dec 26 '19 at 15:36
  • Make sure there are no active connections. Any other clients connected to that database would cause that error. – jens Dec 27 '19 at 06:16