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 1sr8Ef-00Faaa-K9 for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2024 03:53:41 +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 1sr8Ed-0036nV-TH for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2024 03:53:39 +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 1sr8Ed-0036nN-Dc for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2024 03:53:39 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sr8EW-001viu-GV for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2024 03:53:38 +0000 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2d8a54f1250so305478a91.0 for ; Wed, 18 Sep 2024 20:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bitnine-net.20230601.gappssmtp.com; s=20230601; t=1726718009; x=1727322809; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bpqEhxpYY7sKolRNmqCiqnDqo4Tu76yVdFMyOwRf1yk=; b=JFIA721hy0u52Asp+C+6+AWUqoludFfj8vHPLa+K/vLjbZp4Kea6ABuhwN6npypSV/ K9d0nZ3Rn8xhgrBsM2qc9RaofiC0Iu0GlRkK4h6glqmPmKtUzxqPT6CG0oroerne1eBK xy5w6w29hzpBHtzP8epmJBcxBU+BkbjpeIgcbf9PlBYWw64ho2oOy7fnuPGEYLRUDVK2 iZjn7SDnReIOrp/rxmR/xNwLRLEKXAti+Jum+7IhcePwUvEq7V8B5P9DCRNTMh1crWm2 rL9eWCWWhBtz+9il5IGee4/4k+SaeIDC0ahder6+TPSri8qeLNsyU9nWjQ1KiEsbTn/g n7Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726718009; x=1727322809; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bpqEhxpYY7sKolRNmqCiqnDqo4Tu76yVdFMyOwRf1yk=; b=pWcjuYlO/rIK5dlvZVG3xdMV9YYmBenl6RimapJPi9NZ21uYHkeISTJHUL7Q18NxWM /C1SnJmz6wBN/O1IcVtB/bCIkL9ek8nBLl0iGwG2Cd5n3rEdcsHjY2e8b0m9xFfAPFm5 nSfPoyQ7KrM8QOtsNWY4jhJetDSiJMv6WvBRwSPVweCbVCPx/BjKhqDtbsKyqQeF7sws b0acuMuG4Uz8o6Qq4r98biKvofQwBCmkFta74eWaO5w7sGg3cZk+AgJeMN7E+FFifemJ gIoxuxb+yjFiOlIOYGqn9UXcgpPpqn6iVHVjKiyLV1Yul52je4l0oyHqDif80jnAwl0f eJvA== X-Gm-Message-State: AOJu0Yy9h94heuoCgg33T7mMU8LJjVVm5exsWGs8GC8VknR6eeUP3zL8 xQOAz5ZuSHrieU/KH0FqCd94eoL0zUW+jVrB+5SAs7XwN5n7bbJJ6c9cPWw5htiBenA0CJv70DA limktY38DysUhAz2UGhINxURwc4wP1hAMCgqRvw== X-Google-Smtp-Source: AGHT+IHmajyVYTzXMs+4y4HKTwI2xBqIYI+QMKKzTxW4Hs0CPxqzNVRdkWhCHKtUy9gsoIpV6nvfADkO5b3QGRagFEU= X-Received: by 2002:a17:90a:890d:b0:2cb:50fa:b01e with SMTP id 98e67ed59e1d1-2dba0093514mr24862020a91.41.1726718009146; Wed, 18 Sep 2024 20:53:29 -0700 (PDT) MIME-Version: 1.0 References: <1E5F4E2E-EC7C-40E6-905F-F5EF6565F99A@gmail.com> In-Reply-To: <1E5F4E2E-EC7C-40E6-905F-F5EF6565F99A@gmail.com> From: Muhammad Usman Khan Date: Thu, 19 Sep 2024 08:53:13 +0500 Message-ID: Subject: Re: CREATE DATABASE command concurrency To: Wizard Brony Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000009024e1062270ddd0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009024e1062270ddd0 Content-Type: text/plain; charset="UTF-8" Hi, In PostgreSQL, it's safe to run CREATE DATABASE at the same time from different places. If two commands try to create the same database, one will succeed, and the other will safely fail without causing any problems or incomplete database creation. On Wed, 18 Sept 2024 at 19:08, Wizard Brony wrote: > 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? > > > --0000000000009024e1062270ddd0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
In PostgreSQL, it'= ;s safe to run CREATE DATABASE at the same time from different places. If t= wo commands try to create the same database, one will succeed, and the othe= r will safely fail without causing any problems or incomplete database crea= tion.

On Wed, 18 Sept 2024 at 19:08, Wizard Bron= y <wizardbrony@gmail.com>= ; wrote:
What ar= e the concurrency guarantees of the CREATE DATABASE command? For example, i= s the CREATE DATABASE command safe to be called concurrently such that one = command succeeds and the other reliably fails without corruption?


--0000000000009024e1062270ddd0--