Subject: Add strftime escapes to Log config

From: Josh Berkus <[email-masked]>
Date: Sun, 20 Mar 2011 13:32:49 -0700

All,

This page:

http://www.postgresql.org/docs/8.3/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHERE

has the following text:

The value is treated as a strftime pattern, so %-escapes can be used to
specify time-varying file names.

However, nowhere in our docs do we list sample strftime escapes.  This
means that PG DBAs who are not programmers (and even some who are) end
up googling for them all the time.  So I would like to add the following
text:

Useful excape codes which are available on most platforms include: %Y =
year, %m = month, %d = day of month, %H = hour, %M = minute, %a = short
weekday name, and %b = short month name.

-- 
                                  -- Josh Berkus
                                     PostgreSQL Experts Inc.
                                     http://www.pgexperts.com

---

From: Peter Eisentraut <[email-masked]>
Date: Mon, 28 Mar 2011 21:48:30 +0300

> weekday name, and %b = short month name.

We could also link to
<http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html>, for
example.

---

From: Josh Berkus <[email-masked]>
Date: Tue, 29 Mar 2011 11:53:52 -0700

> <http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html>, for

That would be helpful.  I still think we want a few examples in our
docs, though.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

---

From: Robert Haas <[email-masked]>
Date: Tue, 5 Apr 2011 12:46:22 -0400

> That would be helpful.  I still think we want a few examples in our

Patch?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

---

From: Bruce Momjian <[email-masked]>
Date: Mon, 5 Sep 2011 22:58:57 -0400 (EDT)

Peter Eisentraut wrote:
> On s?n, 2011-03-20 at 13:32 -0700, Josh Berkus wrote:
> > This page:
> > 

Agreed.  I have applied the attached patch to 9.1 and head.

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
new file mode 100644
index 4b35169..615b2b0
*** a/doc/src/sgml/config.sgml
--- b/doc/src/sgml/config.sgml
*************** local0.*    /var/log/postgresql
*** 3086,3091 ****
--- 3086,3095 ----
          any time-zone-dependent <literal>%</literal>-escapes, the computation
          is done in the zone specified
          by <xref linkend="guc-log-timezone">.)
+         The supported <literal>%</literal>-escapes are similar to those
+         listed in the Open Group's <ulink
+         url="http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html">strftime
+         </ulink> specification.
          Note that the system's <systemitem>strftime</systemitem> is not used
          directly, so platform-specific (nonstandard) extensions do not work.
         </para>