On Wed, Mar 9, 2016 at 5:46 PM, Haribabu Kommi <kommi.harib...@gmail.com>
> On Wed, Mar 9, 2016 at 10:06 PM, Amit Kapila <amit.kapil...@gmail.com>
> > On Wed, Mar 9, 2016 at 11:46 AM, Haribabu Kommi <
> > wrote:
> >> I tried replacing the random() with PostmaterRandom() for a test and it
> >> worked.
> >> This is generating different random values, so the issue is not
> >> "Global/PostgreSQL.2115609797"
> >> I feel, we should add the the data directory path + the random number
> >> generate the name for dynamic shared memory, this can fix problem.
> > As mentioned above, I think if we can investigate why this error is
> > generated, that will be helpful. Currently the code ensures that if the
> > segment already exists, it should retry to create a segment with other
> > (refer dsm_impl_windows()), so the point of investigation is, why it is
> > going via that path? I am guessing due to some reason
> > is returning NULL in this case whereas ideally it should return the
> > handle with an error ERROR_ALREADY_EXISTS.
> DEBUG: mapped win32 error code 5 to 13
> Yes, the CreateFileMapping() is returning NULL with an error of
Okay, so one probable theory for such an error could be that when there is
already an object with same name exists, this API requests access to the
that existing object and found that it can't access it due to some reason.
On googling, I found some people suggesting to try by disabling UAC  on
your m/c, can you once try that to see what is the result (this experiment
is just to find out the actual reason of failure, rather than a permanent
> I am not able to find the reason for this error. This error is occurring
> when the PostgreSQL is started as a service only.
Did you use pg_ctl register/unregister to register different services. Can
you share the detail steps and OS version on which you saw this behaviour?