Thread: More graceful handling of invalid log_*_stats conf in 7.4

More graceful handling of invalid log_*_stats conf in 7.4

From
Martin Pitt
Date:
Hi PostgreSQL developers!

We just experienced a bug that gave us a serious headache until we
found the reason. When doing "psql template1" we got an error message

  psql: FATAL:  invalid cache id: 30

Evert Meulie found a similar problem at

  http://archives.postgresql.org/pgsql-novice/2004-11/msg00237.php

so maybe it's the same bug, since the thread never came to a
conclusion.

I found out that activating

log_parser_stats = true
log_planner_stats = true
log_executor_stats = true
log_statement_stats = true

in postgresql.conf leads to this bug (test case attached, adapt the
$BIN variable to your postgresql bin directory and run the script). In
8.0 the server complains about an "invalid value for
log_statement_stats", and the documentation explains that the first
three and the 4th option are mutually exclusive. However, this is not
mentioned in the 7.4 docs. Can this case be handled more gracefully in
7.4? Maybe the check from 8.0 can be ported to 7.4?

Thanks and have a nice day!

Martin

--
Martin Pitt              http://www.piware.de
Ubuntu Developer   http://www.ubuntulinux.org
Debian Developer        http://www.debian.org

Attachment

Re: More graceful handling of invalid log_*_stats conf in 7.4

From
Tom Lane
Date:
Martin Pitt <martin@piware.de> writes:
> I found out that activating

> log_parser_stats = true
> log_planner_stats = true
> log_executor_stats = true
> log_statement_stats = true

> in postgresql.conf leads to this bug

This is another manifestation of the 7.4 problem with trying to test
superuser-ness at inappropriate times.  We eventually gave up on the
entire concept of "USERLIMIT" variables.  I don't think there is any
reasonably practical patch to fix it in 7.4, sorry ...

            regards, tom lane

Re: More graceful handling of invalid log_*_stats conf in 7.4

From
Martin Pitt
Date:
Hi!

Tom Lane [2005-06-02 11:46 -0400]:
> Martin Pitt <martin@piware.de> writes:
> > I found out that activating
>=20
> > log_parser_stats =3D true
> > log_planner_stats =3D true
> > log_executor_stats =3D true
> > log_statement_stats =3D true
>=20
> > in postgresql.conf leads to this bug
>=20
> This is another manifestation of the 7.4 problem with trying to test
> superuser-ness at inappropriate times.  We eventually gave up on the
> entire concept of "USERLIMIT" variables.  I don't think there is any
> reasonably practical patch to fix it in 7.4, sorry ...

Ok. To save other people the headache, I will add such a test to
the Debian/Ubuntu distribution scripts, which has the same effect in
the end and is easy to do.

Thanks and have a nice day,

Martin

--=20
Martin Pitt              http://www.piware.de
Ubuntu Developer   http://www.ubuntulinux.org
Debian Developer        http://www.debian.org