Thread: regarding postmaster.pid file

regarding postmaster.pid file

From
"surabhi.ahuja"
Date:
 i have a small query.
when i start postmaster the postmaster.pid file is created by default in the PGDATA directory.
but in case that directory gets full.... if i try to restart postmaster ... it fails because there is not enough space to create the postmaster.pid file/
 
My question is that
while starting postmaster is there an option to specify the location of postmaster.pid file ..
i was thinking if i can keep the postmaster.pid file in a separate folder ..because that folder rarely gets full.
 
similarly while shutting down postmaster i would need to specify the location of the postmaster.pid file.
 
Is there a way avaialble for this?
 
Thanks,
regards
Surabhi

Re: regarding postmaster.pid file

From
Tom Lane
Date:
"surabhi.ahuja" <surabhi.ahuja@iiitb.ac.in> writes:
> My question is that
> while starting postmaster is there an option to specify the location of =
> postmaster.pid file ..
> i was thinking if i can keep the postmaster.pid file in a separate =
> folder ..because that folder rarely gets full.

You do realize that postmaster.pid only takes 100 or so bytes?  If you
are out of space on the database partition, moving the pid file would
*not* help measurably.

            regards, tom lane

Re: regarding postmaster.pid file

From
Greg Stark
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> "surabhi.ahuja" <surabhi.ahuja@iiitb.ac.in> writes:
> > My question is that
> > while starting postmaster is there an option to specify the location of =
> > postmaster.pid file ..
> > i was thinking if i can keep the postmaster.pid file in a separate =
> > folder ..because that folder rarely gets full.
>
> You do realize that postmaster.pid only takes 100 or so bytes?  If you
> are out of space on the database partition, moving the pid file would
> *not* help measurably.

I think he's thinking the other way around. If the file system does fill up he
wants postgres to still be able to start up.

--
greg

Re: regarding postmaster.pid file

From
Tom Lane
Date:
Greg Stark <gsstark@mit.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> You do realize that postmaster.pid only takes 100 or so bytes?  If you
>> are out of space on the database partition, moving the pid file would
>> *not* help measurably.

> I think he's thinking the other way around. If the file system does
> fill up he wants postgres to still be able to start up.

With zero space left, it's unlikely to get far; I repeat my statement
that moving postmaster.pid alone is a useless activity.  (It would be
an incredibly dangerous thing to do anyway, since dissociating
postmaster.pid from the data directory it's supposed to protect would
substantially degrade its trustworthiness as a lock file.)

            regards, tom lane