Skip to content

Instantly share code, notes, and snippets.

@offmessage
Created February 9, 2012 11:56
Show Gist options
  • Save offmessage/1779527 to your computer and use it in GitHub Desktop.
Save offmessage/1779527 to your computer and use it in GitHub Desktop.
Copy a postgres database on the same machine
# old database must be idle (no held open connections or write transactions)
sudo -u postgres createdb newdatabase -T olddatabase
@spacedman
Copy link

doesn't copy database access privileges...

@offmessage
Copy link
Author

Nope. You're right. Any advice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment