rename database postgresql code example
Example 1: rename table postgres
ALTER TABLE table_name
RENAME TO new_table_name;
Example 2: postgres rename database
ALTER DATABASE "old_dbname" RENAME TO "new_dbname"
ALTER TABLE table_name
RENAME TO new_table_name;
ALTER DATABASE "old_dbname" RENAME TO "new_dbname"