Re: [HACKERS] A single escape required for log_filename

2009-02-24 Thread Peter Eisentraut
Robert Haas wrote: Suggested patch attached. I have committed your patch. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] A single escape required for log_filename

2009-02-06 Thread Bruce Momjian
Peter Eisentraut wrote: On Wednesday 14 January 2009 05:23:53 Tom Lane wrote: However, since there's no standard strftime escape for epoch, Robert's proposal to rip out the functionality would break any existing code that still depends on this formatting option. If it came down to this,

Re: [HACKERS] A single escape required for log_filename

2009-02-06 Thread Robert Haas
On Fri, Feb 6, 2009 at 12:44 PM, Bruce Momjian br...@momjian.us wrote: Peter Eisentraut wrote: On Wednesday 14 January 2009 05:23:53 Tom Lane wrote: However, since there's no standard strftime escape for epoch, Robert's proposal to rip out the functionality would break any existing code

Re: [HACKERS] A single escape required for log_filename

2009-01-14 Thread Peter Eisentraut
On Wednesday 14 January 2009 05:23:53 Tom Lane wrote: However, since there's no standard strftime escape for epoch, Robert's proposal to rip out the functionality would break any existing code that still depends on this formatting option. If it came down to this, then I'd say rip it out.

Re: [HACKERS] A single escape required for log_filename

2009-01-14 Thread Joshua D. Drake
On Wed, 2009-01-14 at 18:37 +0200, Peter Eisentraut wrote: On Wednesday 14 January 2009 05:23:53 Tom Lane wrote: However, since there's no standard strftime escape for epoch, Robert's proposal to rip out the functionality would break any existing code that still depends on this formatting

Re: [HACKERS] A single escape required for log_filename

2009-01-14 Thread Robert Haas
If it came down to this, then I'd say rip it out. Naming log files by epoch isn't exactly a user-friendly practice anyway, and there are equivalent but more readable formatting options available. There are other alternatives but they're all ugly. For example, we could make %0 (or some

[HACKERS] A single escape required for log_filename

2009-01-13 Thread Joshua D. Drake
Hello, O.k. so I admit I probably should have known this already but I didn't. Normally I setup logging to use -%a.log. However I had a requirement today that is having me setup a flat filename... as in postgresql.log. When I set it up, it automatically appended the time so I got:

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Tom Lane
Joshua D. Drake j...@commandprompt.com writes: When I set it up, it automatically appended the time so I got: postgresql.log.1231878270 That seems a bit, well wrong. If I say I want postgresql.log I should get postgresql.log. You'd probably reconsider around the time the log file filled your

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Robert Haas
On Tue, Jan 13, 2009 at 4:20 PM, Tom Lane t...@sss.pgh.pa.us wrote: Joshua D. Drake j...@commandprompt.com writes: When I set it up, it automatically appended the time so I got: postgresql.log.1231878270 That seems a bit, well wrong. If I say I want postgresql.log I should get postgresql.log.

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Gregory Williamson
Robert Haas wrote: Joshua D. Drake j...@commandprompt.com writes: When I set it up, it automatically appended the time so I got: postgresql.log.1231878270 That seems a bit, well wrong. If I say I want postgresql.log I should get postgresql.log. You'd probably reconsider around the

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Joshua D. Drake
On Tue, 2009-01-13 at 16:20 -0500, Tom Lane wrote: Joshua D. Drake j...@commandprompt.com writes: When I set it up, it automatically appended the time so I got: postgresql.log.1231878270 That seems a bit, well wrong. If I say I want postgresql.log I should get postgresql.log. You'd

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Tom Lane
Joshua D. Drake j...@commandprompt.com writes: I have perfectly good log rotation utility that exists on my OS. (yes I am aware of the possibility of losing a log entry when using logrotate). You might think you do, but it won't work with PG; external rotators only work with programs that

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Joshua D. Drake
On Tue, 2009-01-13 at 16:58 -0500, Tom Lane wrote: Joshua D. Drake j...@commandprompt.com writes: I have perfectly good log rotation utility that exists on my OS. (yes I am aware of the possibility of losing a log entry when using logrotate). You might think you do, but it won't work with

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Stephen Frost
Joshua, * Joshua D. Drake (j...@commandprompt.com) wrote: When I set it up, it automatically appended the time so I got: postgresql.log.1231878270 That seems a bit, well wrong. If I say I want postgresql.log I should get postgresql.log. Or am I completely cranked? No. I agree with

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: Joshua D. Drake j...@commandprompt.com writes: I have perfectly good log rotation utility that exists on my OS. (yes I am aware of the possibility of losing a log entry when using logrotate). You might think you do, but it won't work with PG; external

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Stephen Frost
* Joshua D. Drake (j...@commandprompt.com) wrote: On Tue, 2009-01-13 at 16:58 -0500, Tom Lane wrote: You might think you do, but it won't work with PG; external rotators only work with programs that respond to SIGHUP by re-opening their log files. copytruncate resolves this issue does it

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Andrew Dunstan
Stephen Frost wrote: Joshua, * Joshua D. Drake (j...@commandprompt.com) wrote: When I set it up, it automatically appended the time so I got: postgresql.log.1231878270 That seems a bit, well wrong. If I say I want postgresql.log I should get postgresql.log. Or am I completely cranked?

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Gregory Stark
Andrew Dunstan and...@dunslane.net writes: Then Debian is (surprise!) not doing the smartest thing. Not using the logging collector means you miss several possible advantages, including CSV logs and protection against multiplexed log lines. Well it's not the smartest thing by your set of

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Robert Haas
On Tue, Jan 13, 2009 at 4:58 PM, Tom Lane t...@sss.pgh.pa.us wrote: Joshua D. Drake j...@commandprompt.com writes: I have perfectly good log rotation utility that exists on my OS. (yes I am aware of the possibility of losing a log entry when using logrotate). You might think you do, but it

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Stephen Frost
Andrew, * Andrew Dunstan (and...@dunslane.net) wrote: Then Debian is (surprise!) not doing the smartest thing. As Gregory pointed out, Debian is doing it for some very good reasons, and is doing it the best it can. Also, I have a huge amount of respect for Martin Pitt (the Debian maintainer),

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Andrew Dunstan
Stephen Frost wrote: Surely a good log rotator allows a custom rotation action (in this case, connecting to postgres and calling 'select pg_rotate_logfile()' ) Yes, logrotate will happily call external applications. Maybe I'm missing something, but obviously if PG can't be configured

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: I'm not sure what postgres does if the filename contains %% as the only escape, although that's would be a fairly ugly hack. Yes, any %-escape is enough to disable the addition of the timestamp. Looking back at the archives, I believe the real reason

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Stephen Frost
Andrew, * Andrew Dunstan (and...@dunslane.net) wrote: Stephen Frost wrote: Yes, logrotate will happily call external applications. Maybe I'm missing something, but obviously if PG can't be configured with a fixed filename, pg_rotate_logfile() doesn't help the situation. I should think a

Re: [HACKERS] A single escape required for log_filename

2009-01-13 Thread Robert Haas
However, since there's no standard strftime escape for epoch, Robert's proposal to rip out the functionality would break any existing code that still depends on this formatting option. I can't say that there is any, but by the same token he can't say there isn't. Absolutely - so the question