Re: [review] PostgreSQL Service on Windows does not start if data directory given is relative path - Mailing list pgsql-hackers

From MauMau
Subject Re: [review] PostgreSQL Service on Windows does not start if data directory given is relative path
Date
Msg-id F069CD0C6B674A84B0E8950A01EA241F@maumau
Whole thread Raw
In response to Re: [review] PostgreSQL Service on Windows does not start if data directory given is relative path  (Magnus Hagander <magnus@hagander.net>)
Responses Re: [review] PostgreSQL Service on Windows does not start if data directory given is relative path
List pgsql-hackers
From: "Magnus Hagander" <magnus@hagander.net>
> We already have two different versions of make_absolute_path() in the tree
> - one in src/backend/utils/init/miscinit.c and one in
> src/test/regress/pg_regress.c.
>
> I don't think we need a third one.
>
> If we put it in port/ like this patch done, then we should make the other
> callers use it. We might need one for frontend and one for backend (I
> haven't looked into that much detail), but definitely the one between
> pg_regress and pg_ctl should be shared.

Agreed.  Sorry, I should have proposed the refactoring.

Rajeev, could you refactor the code so that there is only one 
make_absolute_path()?  I think we can do like this:

1. Delete get_absolute_path() in src/port/path.c.
2. Delete make_absolute_path() in src/test/regress/pg_regress.c.
3. Move make_absolute_path() from src/backend/utils/init/miscinit.c to 
src/port/path.c, and delete the declaration in miscadmin.h.
4. Modify make_absolute_path() in path.c so that it can be used both in 
backend and frontend.  That is, surround the error message output with 
#ifdef FRONTEND ... #else ... #endif.  See some other source files in 
src/port.


Regards
MauMau





pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: OS X and ossp-uuid, next chapter
Next
From: Tom Lane
Date:
Subject: Re: OS X and ossp-uuid, next chapter