Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqvYs-00E6Wi-Lm for pgsql-general@arkaria.postgresql.org; Wed, 18 Sep 2024 14:21:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sqvYr-00AiBU-Li for pgsql-general@arkaria.postgresql.org; Wed, 18 Sep 2024 14:21:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqvYr-00AiBM-B7 for pgsql-general@lists.postgresql.org; Wed, 18 Sep 2024 14:21:41 +0000 Received: from smtp87.ord1d.emailsrvr.com ([184.106.54.87]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqvYn-001pvU-QY for pgsql-general@lists.postgresql.org; Wed, 18 Sep 2024 14:21:40 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id E5923601D0; Wed, 18 Sep 2024 10:21:36 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: CREATE DATABASE command concurrency From: Christophe Pettus In-Reply-To: <1E5F4E2E-EC7C-40E6-905F-F5EF6565F99A@gmail.com> Date: Wed, 18 Sep 2024 07:21:06 -0700 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1E5F4E2E-EC7C-40E6-905F-F5EF6565F99A@gmail.com> To: Wizard Brony X-Mailer: Apple Mail (2.3776.700.51) X-Classification-ID: ee575e99-c371-4a9b-91b9-dbc9ef0c9da2-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Sep 17, 2024, at 14:52, Wizard Brony wrote: >=20 > What are the concurrency guarantees of the CREATE DATABASE command? = For example, is the CREATE DATABASE command safe to be called = concurrently such that one command succeeds and the other reliably fails = without corruption? The concern is that two different sessions issue a CREATE DATABASE = command using the same name? In that case, it can be relied upon that = one will succeed (unless it fails for some other reason, like lacking = permissions), and the other will receive an error that the database = already exists.=