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 1kQcs6-0001Uq-FF for pgsql-sql@arkaria.postgresql.org; Thu, 08 Oct 2020 20:50:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kQcs5-0006Hf-4H for pgsql-sql@arkaria.postgresql.org; Thu, 08 Oct 2020 20:50:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQcs4-0006HY-UZ for pgsql-sql@lists.postgresql.org; Thu, 08 Oct 2020 20:50:40 +0000 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kQcry-0008Th-Lq for pgsql-sql@lists.postgresql.org; Thu, 08 Oct 2020 20:50:39 +0000 Received: by mail-ot1-x342.google.com with SMTP id f37so6833589otf.12 for ; Thu, 08 Oct 2020 13:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0pISk+z0U0jZ4V2zJWtl038Elp3rksWuR1wZ2IWgPUw=; b=COAhlkp8dNvBwewkdMc438BJIvDlU9V+YiEVB8C42ajyQMW/X5R0LBXcFCkUa6NTnL cIGJjcdEFLL1r+xFIKDgIi0v5U5FtlaW72VCY8ABXJwJcjE5VB4uW/X1S8s/I3amhk/u vOnaSHVqq5GcRK5IZnxaBruRX0Lz1Xodj5iEcwj6V3+T+M8IZ+10bhc2hQmKVbsWmDy+ wv83sb9otZlQe02pAPE4MXX9DAvuiA6evBGgqw2VUslQZZX3SieUzEiUzmLuMd4an0JM 0G9CwfYjEDdz2OSH/aUZhhLf3sFaYYjQxVxK87rDf53m9gXNbpCaL4SMvp3n2K4bx8/X J+dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0pISk+z0U0jZ4V2zJWtl038Elp3rksWuR1wZ2IWgPUw=; b=kPfwEECu+oir/ERZ7fJTcDojOdh3Irqc22DG5lz798Kl08oDtQGbLMLZRRB+eHTK7U hQdj1OnzFKgtMTSL/EaTZeo5DAlZJPfCS//B8nmGhIsWUFYrTfZlBpjgd84ZPtVX1u5X pePqIaVaHRHYpfs3nkJVDuz4NK6rSx/TadxD0RAjDtJnpJ9Cbaxgz+Vu+exEQTDkDMXi UjfuOAbWsqE6SrGCegl5BpcMdLs3w6CF+dRWUQTqiD5XTPrNt6OljQeZdwKmYcP8zI5r T/cTBbHqswFFipTNBbbw2o8WOtbO4YFPuwjuUIVQYbiZFzq9Nms9+ATIbLP0mL81Knmh g9uw== X-Gm-Message-State: AOAM533njUA2PYl0bTQDtzf+TcMGHoQmU4lq/ewsKed/0m7sEavwfO+r 4eUktRC+yLNUqsMByvM2shlcSzamX9gbIw== X-Google-Smtp-Source: ABdhPJz8E2aE54LKhZV7Toogi9z6d+z06vriYXgewGt5KCgF7qxgNEP5WvmUgYlh/h8IZrCXluZZGA== X-Received: by 2002:a9d:798f:: with SMTP id h15mr6710643otm.83.1602190233845; Thu, 08 Oct 2020 13:50:33 -0700 (PDT) Received: from ?IPv6:2601:681:5500:dde0:44cf:1e8:85cb:69cf? ([2601:681:5500:dde0:44cf:1e8:85cb:69cf]) by smtp.gmail.com with ESMTPSA id n10sm6516779ooj.19.2020.10.08.13.50.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2020 13:50:33 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: libpq CREATE DATABASE operation from multiple treads From: Rob Sargent In-Reply-To: <47a7c4ffa62aaf2b86854a657f484f33913207c9.camel@gmail.com> Date: Thu, 8 Oct 2020 14:50:31 -0600 Cc: "pgsql-sql@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <23F4DE61-F81D-4740-A227-74B5EB41304C@gmail.com> References: <390804abe88e4e9da9049f6e05c841783acaca47.camel@gmail.com> <124ce8dff8402159f20dec1bc1ac27e26ee39c23.camel@gmail.com> <96718FB0-E258-4342-BD6E-BCE6603BCBD5@gmail.com> <058A9601-35F6-42C1-AC4C-8DD4643E418F@gmail.com> <47a7c4ffa62aaf2b86854a657f484f33913207c9.camel@gmail.com> To: p.sun.fun@gmail.com X-Mailer: Apple Mail (2.3608.120.23.2.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Oct 8, 2020, at 2:46 PM, p.sun.fun@gmail.com wrote: >=20 > On Thu, 2020-10-08 at 14:43 -0600, Rob Sargent wrote: >>=20 >>=20 >>> On Oct 8, 2020, at 2:41 PM, p.sun.fun@gmail.com wrote: >>>=20 >>> 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: >>>>>=20 >>>>> Indeed, this is a FATAL_ERROR. =46rom two threads I got: >>>>>=20 >>>>> // Thread #1 >>>>> FATAL_ERROR: ERROR: source database "template1" is being >>>>> accessed >>>>> by >>>>> other users >>>>> DETAIL: There is 1 other session using the database. >>>>>=20 >>>>> // Thread #2 >>>>> FATAL_ERROR: ERROR: source database "template1" is being >>>>> accessed >>>>> by >>>>> other users >>>>> DETAIL: There is 1 other session using the database. >>>>>=20 >>>> I would try using dbname=3Dpostgres. =20 >>> aaaaand.... it works. Two databases have been created with return >>> status "COMMAND_OK". >>>=20 >>>> If you get the same error, I would say your server is in single >>>> user >>>> mode? >>=20 >> And if you try it again using template1? >>=20 >=20 > Nope, the same errors: > // Thread #1 > FATAL_ERROR: ERROR: source database "template1" is being accessed by > other users > DETAIL: There is 1 other session using the database. >=20 > // Thread #2 > FATAL_ERROR: ERROR: source database "template1" is being accessed by > other users > DETAIL: There is 1 other session using the database. >=20 >=20 >=20 OK, well that=E2=80=99s a special db. Didn=E2=80=99t know it was that = special, though!