2

This question already has an answer here:

Trying to rename a postgres database:

$ psql -d some_other_database
some_other_database=# ALTER DATABASE myapp_development RENAME TO myapp_development_old
some_other_database-# \l
                Name                |  Owner  | Encoding |   Collate   |    Ctype    |  Access privileges
------------------------------------+---------+----------+-------------+-------------+---------------------
 myapp_development                  | rails   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |

No feedback whatsoever after ALTER DATABASE...! I am logged in as a Superuser and not aware of any current connections (but not sure how to be certain of that). What am I missing?

Edit: I erroneously transcribed my prompt in my original question so 2nd line had =# when, indeed (thanks Daniel), it should have had -#. Fixed above, now.

marked as duplicate by Erwin Brandstetter postgresql Mar 23 '15 at 23:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 4
    what's missing: probably a semi-colon at the end of the ALTER command, assuming that you didn't copy verbatim the next prompt. This should be -# instead of =# – Daniel Vérité Mar 21 '15 at 2:02
  • I'm an idiot. thanks! missing semi-colon was the problem. Guess I just kept building my command. So, i'm guessing, the prompt -# vs =# provides a clue? Will pay attention to that moving forward… – Meltemi Mar 21 '15 at 17:06
  • I may delete this question because it's such a silly mistake… unless Daniel wants to post the answer and take credit for it… – Meltemi Mar 21 '15 at 17:16
  • This is explained here and here – a_horse_with_no_name Mar 21 '15 at 17:21
  • This one might also serve as master post: dba.stackexchange.com/questions/66413/… – Erwin Brandstetter Mar 21 '15 at 17:47