p.sun.fun@gmail.com writes:
> Indeed, this is a FATAL_ERROR. From two threads I got:
> // Thread #1
> FATAL_ERROR: ERROR: source database "template1" is being accessed by
> other users
> DETAIL: There is 1 other session using the database.
You'd be better off to connect to some other database than template1;
not only just for this purpose, but in general. If you are issuing
random commands in template1, there's a risk of modifying that database
unexpectedly and thereby changing the contents of databases created
in future.
regards, tom lane