Re: libpq CREATE DATABASE operation from multiple treads - Mailing list pgsql-sql

From Tom Lane
Subject Re: libpq CREATE DATABASE operation from multiple treads
Date
Msg-id 2624889.1602189369@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq CREATE DATABASE operation from multiple treads  (p.sun.fun@gmail.com)
Responses Re: libpq CREATE DATABASE operation from multiple treads
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Rob Sargent
Date:
Subject: Re: libpq CREATE DATABASE operation from multiple treads
Next
From: p.sun.fun@gmail.com
Date:
Subject: Re: libpq CREATE DATABASE operation from multiple treads