Re: [HACKERS] Backend working directories and absolute file paths

2005-07-01 Thread Peter Eisentraut
Tom Lane wrote: You'd have to talk to your kernel provider about that one; we don't have any direct control over where or even whether core dumps occur. Apache used to have (still has?) a way to configure that. I think they must have done the chdir() in the SIGSEGV handler. Not that I'm

[HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Tom Lane
Ciprian Popovici discovered an entirely new way to break the safety interlocks that are meant to prevent you from starting a postmaster in a data directory of the wrong version: http://archives.postgresql.org/pgsql-general/2005-06/msg01349.php While one could say this is pilot error, it's still

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread David Fetter
On Thu, Jun 30, 2005 at 10:55:58AM -0400, Tom Lane wrote: Ciprian Popovici discovered an entirely new way to break the safety interlocks that are meant to prevent you from starting a postmaster in a data directory of the wrong version:

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: On Thu, Jun 30, 2005 at 10:55:58AM -0400, Tom Lane wrote: Ciprian Popovici discovered an entirely new way to break the safety interlocks that are meant to prevent you from starting a postmaster in a data directory of the wrong version:

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread David Fetter
On Thu, Jun 30, 2005 at 11:42:59AM -0400, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: On Thu, Jun 30, 2005 at 10:55:58AM -0400, Tom Lane wrote: Ciprian Popovici discovered an entirely new way to break the safety interlocks that are meant to prevent you from starting a postmaster

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Andrew Dunstan
Tom Lane wrote: What I am speculating about is: 1. At postmaster start (or standalone backend start), chdir into $PGDATA. 2. Henceforth, address everything under $PGDATA by relative paths; don't use DataDir in the path at all. This way, if someone moves

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Andrew Dunstan
David Fetter wrote: On Thu, Jun 30, 2005 at 11:42:59AM -0400, Tom Lane wrote: Renaming data directories around is not that uncommon, With all due respect, I believe that this falls under the category of prying off cover plates. When people do this, they're responsible for knowing

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread David Fetter
On Thu, Jun 30, 2005 at 02:31:01PM -0400, Andrew Dunstan wrote: David Fetter wrote: On Thu, Jun 30, 2005 at 11:42:59AM -0400, Tom Lane wrote: Renaming data directories around is not that uncommon, With all due respect, I believe that this falls under the category of prying

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Greg Stark
Tom Lane [EMAIL PROTECTED] writes: This way, if someone moves a data directory with a running postmaster in it, nothing breaks at all. It would probably run a bit faster too, since file open calls would have fewer directories to traverse through. On reasonable platforms the time spent

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Maybe I have misunderstood. Could the backends not chdir into the db subdir and then do everything relative to that (using .. if necessary)? If we do that then the path to things from the postmaster is different than it is for the children, which is

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Tom Lane
Greg Stark [EMAIL PROTECTED] writes: However it might be nice to have dumps go to a configurable place. You'd have to talk to your kernel provider about that one; we don't have any direct control over where or even whether core dumps occur. There's another approach that seems more robust.

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Greg Stark
Tom Lane [EMAIL PROTECTED] writes: Greg Stark [EMAIL PROTECTED] writes: However it might be nice to have dumps go to a configurable place. You'd have to talk to your kernel provider about that one; we don't have any direct control over where or even whether core dumps occur. Well on most

Re: [HACKERS] Backend working directories and absolute file paths

2005-06-30 Thread Tom Lane
Greg Stark [EMAIL PROTECTED] writes: For that matter, would depending on the cwd interact well with trusted Pl languages that can change the cwd? That would definitely be in the category of don't do that --- but there are such a long list of ways to hose your backend in a trusted PL that adding