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 1kQcm0-0001BX-PF for pgsql-sql@arkaria.postgresql.org; Thu, 08 Oct 2020 20:44:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kQclU-00085D-4b for pgsql-sql@arkaria.postgresql.org; Thu, 08 Oct 2020 20:43:52 +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 1kQclT-000856-Sq for pgsql-sql@lists.postgresql.org; Thu, 08 Oct 2020 20:43:51 +0000 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kQclQ-0001I4-OQ for pgsql-sql@lists.postgresql.org; Thu, 08 Oct 2020 20:43:51 +0000 Received: by mail-ot1-x343.google.com with SMTP id i12so6891765ota.5 for ; Thu, 08 Oct 2020 13:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=qDY6j6WysOQcnwfnjU+jzYesDp61chs1wMjEu08Hv7g=; b=J4AgdQkEvUxt3V40sX11WCz6MLo588OnheAS8Oq7a0cDjugoP9prTDcDGrLiuR1IGB Xijam7LU7mAfugn5oaPlpKkPV6ptUT/YDFU30h6UADqM7VDdGWw33BqSDq5KF1utCGdo 7F/kbBnE9uO2DWiEnjr2xD74kANAzmECu5RbW2D5TX/bI1R2FwZxitiJtNaNArw9Y3HA x8ef4R7kmuZ04Dv7CyqcWvyo3d+UW/vrQnBJpItw8JuD5udlZ+DRK/SbPYq2wMfC61NB Nb6KIdaSMUYw6xTu2I+e7wkaB/lAzuLOtrGy1dZzzCZ2x2kCIMiHsdNZ4wjXIEkjYSjd X/kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=qDY6j6WysOQcnwfnjU+jzYesDp61chs1wMjEu08Hv7g=; b=aXC0Amln8Vxu6eglPqu7q6oKTKhaCJpwdbpXR9uWr5JAJTZVoIEukP/1ypc4iWO8V7 xpfshjwXnYXXcqsJAC6W6jOR6GBRyDkpk6vN/AV/xA3neI2mBxWB+NPQe7ctCaMtbHeW 8+LOHau3dWA6QmpYA1Nz+H/IUCoXa+oICk0VyU4yvNNSka/YoEaYauP/wkf6ggbgJHDy OPmG29s55szmAJ2aUUQYk6PdBCOcDOI8sXLZoHhSjlCpFQLo8U+ZsJv1PjrB5jtuhRK1 lORgK7vhtsb0N0n1beJIZv+MXDlIIqj6OgpWRSsTB2iQxlFFiK7bCGbtZvbVoNSBlaTu 06yA== X-Gm-Message-State: AOAM532D+P5l1Wd9kgemOaLvcd/svejtYD9rg9sMpUSRXUKX2QWH35nO /rif+lcBANw3QasqYbEZnNY= X-Google-Smtp-Source: ABdhPJzlV1RA5+Nlw+nuOU+eqeFvnQMkpMHAkkgH8uvzS1BQcvX+N5Bh/GArSM94bRmlll7ZXDvMPQ== X-Received: by 2002:a9d:6399:: with SMTP id w25mr6301219otk.202.1602189827052; Thu, 08 Oct 2020 13:43:47 -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 a16sm4833363otk.39.2020.10.08.13.43.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2020 13:43:46 -0700 (PDT) From: Rob Sargent Message-Id: <058A9601-35F6-42C1-AC4C-8DD4643E418F@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_584ED61B-7595-4BD3-858C-F4567BCA51D3" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: libpq CREATE DATABASE operation from multiple treads Date: Thu, 8 Oct 2020 14:43:45 -0600 In-Reply-To: Cc: pgsql-sql@lists.postgresql.org To: p.sun.fun@gmail.com References: <390804abe88e4e9da9049f6e05c841783acaca47.camel@gmail.com> <124ce8dff8402159f20dec1bc1ac27e26ee39c23.camel@gmail.com> <96718FB0-E258-4342-BD6E-BCE6603BCBD5@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 --Apple-Mail=_584ED61B-7595-4BD3-858C-F4567BCA51D3 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Oct 8, 2020, at 2:41 PM, p.sun.fun@gmail.com wrote: > > 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? And if you try it again using template1? --Apple-Mail=_584ED61B-7595-4BD3-858C-F4567BCA51D3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Oct 8, 2020, at 2:41 PM, p.sun.fun@gmail.com = wrote:

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. =46rom 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=3Dpostgres.  
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?

And if you try it again using template1?

= --Apple-Mail=_584ED61B-7595-4BD3-858C-F4567BCA51D3--