[snip]
> I think the idea is to edit the postgresql.conf file on the fly and send
> a SIGHUP to the postmaster. I haven't ever heard of anyone doing that,
> but I don't see any reason why it wouldn't work.
It works, I did it for a while with the statement_timeout to change it
globally over night when admin tasks were running. For the
statement_timeout thing it wasn't optimal however, finally I had to
ditch the thing... but it can be done.
See below my shell script attached, it did work for me, YMMV.
Cheers,
Csaba.
#!/bin/sh
CONF_FILE=/var/lib/postgres/data-8_1_3p/postgresql.conf
PG_CTL=/usr/local/postgres813p/bin/pg_ctl
PG_DIR=/var/lib/postgres/data-8_1_3p
TIMEOUT=0
if [ -n "$1" ]; then
TIMEOUT=$1
fi
cat $CONF_FILE | sed "s/^\(statement_timeout =
\)[0123456789]\+/\1$TIMEOUT/" > $CONF_FILE.new
mv $CONF_FILE.new $CONF_FILE
$PG_CTL -D $PG_DIR reload