Re: serverlog rotation/functions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: serverlog rotation/functions
Date: 2004-07-16 18:38:41
Message-ID: 200407161838.i6GIcfM07476@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2004-07-16 19:56:32 case sensitivity in PQExecPrepared
Previous Message Bruce Momjian 2004-07-16 18:32:45 Re: serverlog rotation/functions