SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE datname='<db_name>';DROP DATABASE <db_name>; SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE datname='<db_name>';ALTER DATABASE <old_db_name> RENAME TO <new_db_name>;
沒有留言:
張貼留言