Last active
March 11, 2021 22:36
-
-
Save raicerk/4162cecb206e30ae90d0be30f381ceb9 to your computer and use it in GitHub Desktop.
Clonar db postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = 'develop' AND pid <> pg_backend_pid(); | |
CREATE DATABASE develop WITH TEMPLATE qa OWNER userdb; | |
ALTER DATABASE develop RENAME TO newdevelop; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment