pgsql: Avoid performing encoding conversion on command tag strings

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid performing encoding conversion on command tag strings
Date: 2010-01-30 20:09:53
Message-ID: 20100130200953.1E3EE7541B9@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Avoid performing encoding conversion on command tag strings during EndCommand.

Since all current and foreseeable future command tags will be pure ASCII,
there is no need to do conversion on them. This saves a few cycles and also
avoids polluting otherwise-pristine subtransaction memory contexts, which
is the cause of the backend memory leak exhibited in bug #5302. (Someday
we'll probably want to have a better method of determining whether
subtransaction contexts need to be kept around, but today is not that day.)

Backpatch to 8.0. The cycle-shaving aspect of this would work in 7.4
too, but without subtransactions the memory-leak aspect doesn't apply,
so it doesn't seem worth touching 7.4.

Modified Files:
--------------
pgsql/src/backend/tcop:
dest.c (r1.76 -> r1.77)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/dest.c?r1=1.76&r2=1.77)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-01-30 20:09:59 pgsql: Avoid performing encoding conversion on command tag strings
Previous Message Tom Lane 2010-01-30 18:59:58 pgsql: Fix memory leakage introduced into print_aligned_text by 8.4