Skip site navigation (1) Skip section navigation (2)

pgsql: Repair an error introduced by log_line_prefix patch: it is not

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Repair an error introduced by log_line_prefix patch: it is not
Date: 2005-11-05 03:04:53
Message-ID: 20051105030453.7B690DA266@svr1.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Repair an error introduced by log_line_prefix patch: it is not acceptable
to assume that the string pointer passed to set_ps_display is good forever.
There's no need to anyway since ps_status.c itself saves the string, and
we already had an API (get_ps_display) to return it.
I believe this explains Jim Nasby's report of intermittent crashes in
elog.c when %i format code is in use in log_line_prefix.
While at it, repair a previously unnoticed problem: on some platforms such as
Darwin, the string returned by get_ps_display was blank-padded to the maximum
length, meaning that lock.c's attempt to append " waiting" to it never worked.

Modified Files:
--------------
    pgsql/src/backend/postmaster:
        postmaster.c (r1.474 -> r1.475)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/postmaster.c.diff?r1=1.474&r2=1.475)
    pgsql/src/backend/storage/lmgr:
        lock.c (r1.158 -> r1.159)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lock.c.diff?r1=1.158&r2=1.159)
    pgsql/src/backend/utils/error:
        elog.c (r1.166 -> r1.167)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/error/elog.c.diff?r1=1.166&r2=1.167)
    pgsql/src/backend/utils/misc:
        ps_status.c (r1.25 -> r1.26)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/ps_status.c.diff?r1=1.25&r2=1.26)
    pgsql/src/include/libpq:
        libpq-be.h (r1.52 -> r1.53)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/libpq/libpq-be.h.diff?r1=1.52&r2=1.53)
    pgsql/src/include/utils:
        ps_status.h (r1.25 -> r1.26)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/ps_status.h.diff?r1=1.25&r2=1.26)

pgsql-committers by date

Next:From: Tom LaneDate: 2005-11-05 03:05:05
Subject: pgsql: Repair an error introduced by log_line_prefix patch: it is not
Previous:From: Bruce MomjianDate: 2005-11-05 01:38:44
Subject: pgsql: Add mention to update FAQ item on most recent release to

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group