DBA Hub

📋Steps in this guide1/1

Drop database in postgres

- Drop database from psql Note - while dropping a database, you need to connect to a database other than the db you are trying to drop.

postgresql configurationintermediate
by PostgreSQL
14 views
1

Drop database in postgres

- Drop database from psql Note - while dropping a database, you need to connect to a database other than the db you are trying to drop. -- Drop database using dropdb os utility

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
postgres=#
\conninfo
You are connected to database "postgres" as user "postgres" on host "localhost" at port "5432".
postgres#
drop database "DBACLASS";
postgres$ pwd
/Library/PostgreSQL/10/bin
postgres$
./dropdb -e "DBACLASS"
Password:
SELECT pg_catalog.set_config('search_path', '', false)
DROP DATABASE "DBACLASS";
For complete article visit -  >
https://dbaclass.com/article/drop-database-postgres/

Comments (0)

Please to add comments

No comments yet. Be the first to comment!