Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Andreas Pflug
Bruce Momjian wrote: Andreas Pflug wrote: You do something that splits the value into directory name and file name and removes every letter after %. /var/log postgresql.log.%-%-%_%%% Another idea is to allow filename wildcards in the listing so it becomes: SELECT *

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Tom Lane
Andreas Pflug [EMAIL PROTECTED] writes: In-use check is easy for the backend, if the syslog process publishes the current logfile's timestamp in sharedmem. You really haven't absorbed any of the objections I've raised, have you? I don't want the log process connected to shared mem at *all*,

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Bruce Momjian
Andreas Pflug wrote: OK, it would be nice if we could do a sed operation like: sed 's/%./*/g' but I don't know a way to do that without defining a function or pulling in a procedural language, but if we could do it we could do: pg_dir(echo log_destination | sed

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Andreas Pflug
Bruce Momjian wrote: This seems quite involved. Can we get the basic functionality I described first? On the way. Also I am not sure how all this information is going to be passed from the logging process to the backend requesting the information, and it seems overly complicated. There's *no*

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: In-use check is easy for the backend, if the syslog process publishes the current logfile's timestamp in sharedmem. You really haven't absorbed any of the objections I've raised, have you? I don't want the log process connected to shared

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Bruce Momjian
Andreas Pflug wrote: Bruce Momjian wrote: This seems quite involved. Can we get the basic functionality I described first? On the way. Also I am not sure how all this information is going to be passed from the logging process to the backend requesting the information, and it

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Bruce Momjian
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 :-)

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Andreas Pflug
Bruce Momjian wrote: - How's the official way to restrict pg_* functions to superuser only Very crudely :-) Got it. 'nother question: Is reading the logfile a task that may be allowed to superusers only? I don't think so, though acls might apply. Uh, that seems fine. You already check to see

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Bruce Momjian
Andreas Pflug wrote: Bruce Momjian wrote: - How's the official way to restrict pg_* functions to superuser only Very crudely :-) Got it. 'nother question: Is reading the logfile a task that may be allowed to superusers only? I don't think so, though acls might apply. Yes, the

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Andreas Pflug
Bruce Momjian wrote: Ok, no limit (but a default maximum of 50k remains). And since it's superuser only, he hopefully knows what he does. Huh? Why have a default maximum? Just for convenience. Both start and size are optional parameters, but with start=0 and size=5. Well, it's a very

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Andreas Pflug
Andreas Pflug wrote: Ah wait. Digging further behind SIGUSR1 I now *do* see a solution without pid in shmem, using SendPostmasterSignal. Well, a little hint from gurus would have helped... Oops, SendPostmasterSignal uses shmem At least, this enables syslogger.c to be free from shmem stuff,

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Bruce Momjian
Andreas Pflug wrote: Bruce Momjian wrote: Ok, no limit (but a default maximum of 50k remains). And since it's superuser only, he hopefully knows what he does. Huh? Why have a default maximum? Just for convenience. Both start and size are optional parameters, but with start=0 and

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Bruce Momjian
Andreas Pflug wrote: Andreas Pflug wrote: Ah wait. Digging further behind SIGUSR1 I now *do* see a solution without pid in shmem, using SendPostmasterSignal. Well, a little hint from gurus would have helped... Oops, SendPostmasterSignal uses shmem At least, this

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Bruce Momjian
Andreas Pflug wrote: Bruce Momjian wrote: Andreas Pflug wrote: Right. We already have to use shared mem for the backends and postmaster. It is the logger we are worried about. Tom brought up the point that if the logger used shared memory, we would have to kill/restart it if we

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Andreas Pflug
Bruce Momjian wrote: Andreas Pflug wrote: Right. We already have to use shared mem for the backends and postmaster. It is the logger we are worried about. Tom brought up the point that if the logger used shared memory, we would have to kill/restart it if we need to reinitialize shared memory, I

Re: [HACKERS] serverlog rotation/functions

2004-07-16 Thread Andreas Pflug
Bruce Momjian wrote: Andreas Pflug wrote: Just for convenience. Both start and size are optional parameters, but with start=0 and size=5. Well, it's a very special function anyway, so we could require the user to supply all parameters. I'll remove it. Agreed, and maybe a zero value gets the