PostgreSQL Service on Windows does not start if data directory given is relative path - Mailing list pgsql-hackers

From Rajeev rastogi
Subject PostgreSQL Service on Windows does not start if data directory given is relative path
Date
Msg-id BF2827DCCE55594C8D7A8F7FFD3AB7713DDB5BEC@SZXEML508-MBX.china.huawei.com
Whole thread Raw
Responses Re: PostgreSQL Service on Windows does not start if data directory given is relative path
List pgsql-hackers

I have found a case that PostgreSQL as win32 service does not start, if the data directory given as relative path.

Error observed in this case is:

                                “The PostgreSQL on Local Computer started and then stopped”.

 

This may happen because relative path given will be relative to path from where service is registered but

the path from where WIN32 service execution gets invoked may be different and hence it won’t be able

to find the  data directory.

 

I have fixed the same by internally converting the relative path to absolute path as it is being done for executable file.

 

Attached is the patch with the fix.

Please provide your opinion.

 

I will add this to Jan 2014 CommitFest.

 

Thanks and Regards,

Kumar Rajeev Rastogi

 

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: dynamic shared memory and locks
Next
From: Sandeep Thakkar
Date:
Subject: Re: Compiling extensions on Windows