PostgreSQLの設定(ubuntu10.04)
postgresql.confの設定
$ vim /var/lib/postgresql/data/postgresql.conf
設定内容は以下のとおり。
# - Where to Log -<
<
log_destination = 'stderr'>->---# Valid values are combinations of<
>--->--->--->--->---# stderr, csvlog, syslog and eventlog,<
>--->--->--->--->---# depending on platform. csvlog<
>--->--->--->--->---# requires logging_collector to be on.<
<
# This is used when logging to stderr:<
logging_collector = on>->---# Enable capturing of stderr and csvlog<
>--->--->--->--->---# into log files. Required to be on for<
>--->--->--->--->---# csvlogs.<
>--->--->--->--->---# (change requires restart)<
<
# These are only used if logging_collector is on:<
log_directory = 'pg_log'>--->---# directory where log files are written,<
>--->--->--->--->---# can be absolute or relative to PGDATA<
log_filename = 'postgresql-%Y-%m-%d.log'>---# log file name pattern,<
>--->--->--->--->---# can include strftime() escapes<
log_truncate_on_rotation = off>->---# If on, an existing log file of the<
>--->--->--->--->---# same name as the new log file will be<
>--->--->--->--->---# truncated rather than appended to.<
>--->--->--->--->---# But such truncation only occurs on<
>--->--->--->--->---# time-driven rotation, not on restarts<
>--->--->--->--->---# or size-driven rotation. Default is<
>--->--->--->--->---# off, meaning append to existing files<
>--->--->--->--->---# in all cases.<
log_rotation_age = 1440>>--->---# Automatic rotation of logfiles will<
>--->--->--->--->---# happen after that time. 0 disables.<
log_rotation_size = 0>-->---# Automatic rotation of logfiles will-<
# - When to Log -<
<
client_min_messages = notice>--->---# values in order of decreasing detail:<
>--->--->--->--->---# debug5<
>--->--->--->--->---# debug4<
>--->--->--->--->---# debug3<
>--->--->--->--->---# debug2<
>--->--->--->--->---# debug1<
>--->--->--->--->---# log<
>--->--->--->--->---# notice<
>--->--->--->--->---# warning<
>--->--->--->--->---# error<
<
log_min_messages = warning>->---# values in order of decreasing detail:<
>--->--->--->--->---# debug5<
>--->--->--->--->---# debug4<
>--->--->--->--->---# debug3<
>--->--->--->--->---# debug2<
>--->--->--->--->---# debug1<
>--->--->--->--->---# info<
>--->--->--->--->---# notice<
>--->--->--->--->---# warning<
>--->--->--->--->---# error<
>--->--->--->--->---# log<
>--->--->--->--->---# fatal<
>--->--->--->--->---# panic<
log_min_error_statement = warning>--# values in order of decreasing detail:<
>--->--->--->--- >--# debug5<
>--->--->--->--->---# debug4<
>--->--->--->--->---# debug3<
>--->--->--->--->---# debug2<
>--->--->--->--->---# debug1<
>--->--->--->--- >--# info<
>--->--->--->--->---# notice<
>--->--->--->--->---# warning<
>--->--->--->--->---# error<
>--->--->--->--->---# log<
>--->--->--->--->---# fatal<
>--->--->--->--->---# panic (effectively off)<
<
log_min_duration_statement = 0>-# -1 is disabled, 0 logs all statements<
>--->--->--->--->---# and their durations, > 0 logs only<
>--->--->--->--->---# statements running at least this number<
>--->--->--->--->---# of milliseconds<
log_duration = off
log_line_prefix = '%m %d %e[%p-%l] '>>--->---# special values:<
>--->--->--->--->---# %u = user name<
>--->--->--->--->---# %d = database name<
>--->--->--->--->---# %r = remote host and port<
>--->--->--->--->---# %h = remote host<
>--->--->--->--->---# %p = process ID<
>--->--->--->--->---# %t = timestamp without milliseconds<
>--->--->--->--->---# %m = timestamp with milliseconds<
>--->--->--->--->---# %i = command tag<
>--->--->--->--->---# %c = session ID<
>--->--->--->--->---# %l = session line number<
>--->--->--->--->---# %s = session start timestamp<
>--->--->--->--->---# %v = virtual transaction ID<
>--->--->--->--->---# %x = transaction ID (0 if none)<
>--->--->--->--->---# %q = stop here in non-session<
>--->--->--->--->---# processes<
>--->--->--->--->---# %% = '%'<
>--->--->--->--->---# e.g. '<%u%%%d> '<