---$> psql: user my_user and database my_original_db must exists:
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'my_original_db' AND pid <> pg_backend_pid();
CREATE DATABASE my_new_db WITH TEMPLATE my_original_db OWNER my_user;
Create a copy from a Database in the same postgres server.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.