Re: CREATE DATABASE command concurrency

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Wizard Brony <wizardbrony(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: CREATE DATABASE command concurrency
Date: 2024-09-18 14:21:06
Message-ID: D36748A9-A7FA-48DF-B8D0-A14E5DE545EF@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Sep 17, 2024, at 14:52, Wizard Brony <wizardbrony(at)gmail(dot)com> 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?

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-09-18 14:50:26 Re: load fom csv
Previous Message Rob Sargent 2024-09-18 13:29:57 Re: load fom csv