Re: logfile subprocess and Fancy File Functions - Mailing list pgsql-patches

From Stephan Szabo
Subject Re: logfile subprocess and Fancy File Functions
Date
Msg-id 20040723141948.I55662@megazone.bigpanda.com
Whole thread Raw
In response to Re: logfile subprocess and Fancy File Functions  (Andreas Pflug <pgadmin@pse-consulting.de>)
Responses Re: logfile subprocess and Fancy File Functions
List pgsql-patches
On Fri, 23 Jul 2004, Andreas Pflug wrote:

> > What we probably want instead is a separate
> > redirect_stderr_to_files boolean (I'm sure a better name could be
> > thought of).
> >
> > Also, while I'm aware that a superuser can persuade the backend to write
> > on anything, it doesn't follow that we should invent pg_file_write(),
> > pg_file_rename(), or pg_file_unlink().  Those are not needed for the
> > originally intended purpose of this patch
>
> I proposed to separate them, they're indeed non-related.
> What I'd like is
>
> SELECT pg_file_unlink('postgresql.conf.bak');
> SELECT pg_file_write('postgresql.conf.tmp', 'listen_addresses=...');
> SELECT pg_file_rename('postgresql.conf.tmp', 'postgresql.conf',
>                        'postgresql.conf.bak');
> SELECT pg_reload_conf();

I personally don't think the above is the correct approach to allowing
configuration editing from remote. It seems like the wrong level for the
interface, and the file rename isn't atomic and pretending that it is may
prove to be dangerous.

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Updated logging config (was: Initial eventlog support on win32 )
Next
From: Tom Lane
Date:
Subject: Re: logfile subprocess and Fancy File Functions