Search Postgresql Archives

Re: How to implement autostart of postgres?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Craig Ringer <craig@xxxxxxxxxxxxxxxxxxxxx> writes:
> On 28/07/11 18:06, Gavrina, Irina wrote:
>> Is there any risk of losing of data or data corruption in this case?

> Possibly, if you then remove postmaster.pid, thus bypassing the other
> safety, and start a new postmaster.

> I'm a bit alarmed to discover that Ubuntu's postgresql packaging appears
> to do exactly this.
> ...
> It merrily removes the pid file without any effort to check if there are
> backends using that datadir, then goes on to relaunch the postmaster.

> Is this sane? Safe?

No, and no.  The postmaster is capable of removing the old pidfile if it
really is stale, and any scripted substitute for that is highly likely
to be unsafe.  You do have to be a bit careful about how you code the
script though, to ensure that the postmaster won't see false positives.
Martin, is that code your responsibility?

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux