Today I Learned

hashrocket A Hashrocket project

Rename PostgreSQL Database

From time to time, you may find yourself needing to rename a database in Postgres. Luckily, you can do that with the ALTER DATABASE command. In psql, run:

ALTER DATABASE hashrocket_test_db_instance RENAME TO hashrocket_test;

Read more - PostgreSQL Tutorials - ALTER DATABASE

See More #sql TILs
Looking for help? Hashrocket developers believe that data quality is as important as code quality. We enjoy all the challenges of relational databases, from finding the fastest index, to structuring data to fit the needs of an application. We're eager to share our experiences; check out PG Casts, our series of free PostgreSQL screencasts.