Skip to content

Instantly share code, notes, and snippets.

@CEZERT
Created April 14, 2023 11:54
Show Gist options
  • Save CEZERT/008e3313d0dd67be6ba3a9b9ccb397ce to your computer and use it in GitHub Desktop.
Save CEZERT/008e3313d0dd67be6ba3a9b9ccb397ce to your computer and use it in GitHub Desktop.
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='23-0241ACA_LOT_7' AND pid <> pg_backend_pid();
create database "23-0242ACA_LOT_8" template "23-0241ACA_LOT_7";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment