change database name psql 8 1

change database name psql 8

# Remember to check active connections to the db and close them
ALTER DATABASE your_db_name RENAME TO new_name;

Here is what the above code is Doing:
1. First, we’re telling Postgres to connect to the database named “postgres”
2. Then, we’re telling Postgres to connect to the database named “your_db_name”
3. Then, we’re telling Postgres to rename the database named “your_db_name” to “new_name”

Similar Posts