Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQciw-00013O-OG for pgsql-sql@arkaria.postgresql.org; Thu, 08 Oct 2020 20:41:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kQciv-0005Fn-Kv for pgsql-sql@arkaria.postgresql.org; Thu, 08 Oct 2020 20:41:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQciv-0005Fg-CI for pgsql-sql@lists.postgresql.org; Thu, 08 Oct 2020 20:41:13 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kQciq-0001HL-JV for pgsql-sql@lists.postgresql.org; Thu, 08 Oct 2020 20:41:13 +0000 Received: by mail-pl1-x644.google.com with SMTP id bb1so3352667plb.2 for ; Thu, 08 Oct 2020 13:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=1Y2fYnw9I4D9VxpeMyU9GIERHRtnxn2QhngSVlpJrTM=; b=CtoXbI7ia/wNYz4lNLJS+Gs5Lo646RSrV2KyJZw4W1TND2ewe2uG0306y5v/kR0yes w4mWulWeaZt219YQO1BZGannLwLBopQlVnSpsmQz9GebQlJkmm+sHNGuqN4kdTv6WNMy hagVrDGtLWf7HeClK4rxk1pELm0ORcjFm0RgLNp6T4MJsNllna/B9ic+SuQ5TCn9740p E4wbbMSPezWdObQidWXQ8LeKhft3kQ9P19GYs0BqLUk35dPZp7NNIKIWijsls5e5EofI cZD2YjYdtbXSoaKN0I5QksSf6c63PWCj7Ki+MPB+jBlCcAVbVHe+CBix58i1Px2Zwd0k B+sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=1Y2fYnw9I4D9VxpeMyU9GIERHRtnxn2QhngSVlpJrTM=; b=fBa2aVepFfPo1vr2Qrv8/AAur/jl0XLYH4A6CuJVxWRA30/oH98v7od+DCqYy6WMx5 poFe1RmUaDiMtlVI8VNVYq2w0F2tTPoClVJ3nnC7bF155dv646oXtngseMc8bR4i1ksq HYBipJkehCS4hUCwP5UEJVKL9gOtcYlelfCc+fJfeLbcZVRgEeWSTF4srogKvXt1x53q OiFS1n64RHlVjZc3MGrx2qe6AVCL+lmij/amS4ZG8oz9P6Ghi+gC8KOizu45WFD046aM ja+HvrxemkApzXqVKYWdgXjCmj6WzInfdOojf7+aU/jPbmjjDBo0nDbLzTYqsCpQj/lL EgiA== X-Gm-Message-State: AOAM532vVFeMTNncAM0aZGEon4tQlNDJ2LfXPgT95Cbep7ue+qVaXebr NXpqiXrfTVVpV+apY5VSRye8XDtWlpM= X-Google-Smtp-Source: ABdhPJzIxhTlZNWwxh7QBxBqYdPmgNDFTB6kLX2djf1lG0vQEtCNu7kOnPrAH46jQW34uU9JopK2rw== X-Received: by 2002:a17:902:6b4a:b029:d3:e8f4:3356 with SMTP id g10-20020a1709026b4ab02900d3e8f43356mr9453679plt.0.1602189666411; Thu, 08 Oct 2020 13:41:06 -0700 (PDT) Received: from pavlo-debian ([204.147.87.6]) by smtp.gmail.com with ESMTPSA id bf12sm7956645pjb.17.2020.10.08.13.41.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 13:41:05 -0700 (PDT) Message-ID: Subject: Re: libpq CREATE DATABASE operation from multiple treads From: p.sun.fun@gmail.com To: pgsql-sql@lists.postgresql.org Date: Thu, 08 Oct 2020 15:41:01 -0500 In-Reply-To: <96718FB0-E258-4342-BD6E-BCE6603BCBD5@gmail.com> References: <390804abe88e4e9da9049f6e05c841783acaca47.camel@gmail.com> <124ce8dff8402159f20dec1bc1ac27e26ee39c23.camel@gmail.com> <96718FB0-E258-4342-BD6E-BCE6603BCBD5@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2020-10-08 at 14:35 -0600, Rob Sargent wrote: > > On Oct 8, 2020, at 2:30 PM, p.sun.fun@gmail.com wrote: > > > > 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. > > > > // Thread #2 > > FATAL_ERROR: ERROR: source database "template1" is being accessed > > by > > other users > > DETAIL: There is 1 other session using the database. > > > I would try using dbname=postgres. aaaaand.... it works. Two databases have been created with return status "COMMAND_OK". > If you get the same error, I would say your server is in single user > mode? >