pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Lazurkin <dilaz03@gmail.com>
To: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Does PostgreSQL use atomic file creation of FS?
Date: Wed, 12 Dec 2018 15:52:03 +0300
Message-ID: <eb710719-3a2a-522a-39c9-2ebcdc24bb1b@gmail.com> (raw)
In-Reply-To: <20181212123733.GA29783@hermes.hilbert.loc>
References: <f4703403-9c8e-6a21-a7cc-0e7137bdccdf@gmail.com>
	<20181212123733.GA29783@hermes.hilbert.loc>

Thank you. But I have read this. I said about network file system only
for example. I would like to known how PostgreSQL handles this specific
case (of course if someone knowns a answer):

fd = open(file, "w");
write(fd, data);
// crash and now I have empty file which isn't correct
fsync(fd);

PS. I think PostgreSQL doesn't have this problem.

On 12/12/18 15:37, Karsten Hilbert wrote:
> On Wed, Dec 12, 2018 at 02:48:12PM +0300, Dmitry Lazurkin wrote:
>
>> Does PostgreSQL use atomic file creation on FS? How does PostgreSQL
>> catch situation when system crashes between open call and write call? I
>> am interesting in this because I would like use PostgreSQL on network
>> file system.
> I doubt we can get more certainty than this:
>
> 	https://www.postgresql.org/docs/devel/creating-cluster.html#CREATING-CLUSTER-NFS
>
> Best,
> Karsten







view thread (5+ messages)  latest in thread

Message-ID: <eb710719-3a2a-522a-39c9-2ebcdc24bb1b@gmail.com>
Permalink:  ../eb710719-3a2a-522a-39c9-2ebcdc24bb1b@gmail.com/
Also on:    postgresql.org/message-id/eb710719-3a2a-522a-39c9-2ebcdc24bb1b@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: dilaz03@gmail.com, Karsten.Hilbert@gmx.net
  Subject: Re: Does PostgreSQL use atomic file creation of FS?
  In-Reply-To: <eb710719-3a2a-522a-39c9-2ebcdc24bb1b@gmail.com>
  References: <f4703403-9c8e-6a21-a7cc-0e7137bdccdf@gmail.com> <20181212123733.GA29783@hermes.hilbert.loc> <eb710719-3a2a-522a-39c9-2ebcdc24bb1b@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox