Re: serverlog rotation/functions - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: serverlog rotation/functions
Date
Msg-id 200407161838.i6GIcfM07476@candle.pha.pa.us
Whole thread Raw
Responses Re: serverlog rotation/functions  (Andreas Pflug <pgadmin@pse-consulting.de>)
List pgsql-hackers
Andreas Pflug wrote:
> Bruce Momjian wrote:
> 
> > 
> > This seems quite involved.  Can we get the basic functionality I
> > described first? 
> 
> Current workable patch.
> 
> Some questions/limitations:
> - How's the official way to restrict pg_* functions to superuser only

Very crudely  :-)static int pg_signal_backend(int pid, int sig){    if (!superuser())        ereport(ERROR,
  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),                 (errmsg("only superuser can signal other backends"))));
 

> - I've restricted pg_file_read to 50k max. What's a reasonable limit for 
> a generic function?

Uh, that seems fine.  You already check to see it is within the limit. 
I think a bigger question is should we limit it at all?  Do we limit
pg_largeobject?  Is that similar?

> - pg_file_read and pg_file_write read/write text only; should have 
> binary versions too.

I guess we could but no one is asking for that yet so I would leave it
for later.

> Very open question:
> - How should a backend know the logger's pid if it's not in shmem. Write 
> a magic string to the pipe?

I think it has to and in fact the pid is being written by the
postmaster, not by the logger process, so that should be OK.  The issue
is that the logger shouldn't _attach_ to shared memory unless it has to.

As far as recording the current log timestamp, I think that will be a
problem.  I would much rather see us forget about doing timestamp
processing with these log files and keep it simple at this point and see
what needs we have for 7.6.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: serverlog rotation/functions
Next
From: Bruce Momjian
Date:
Subject: Re: Point in Time Recovery