git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: b6eab50) | patch
Clean up logging for extended-query-protocol operations, as per my recent
Thu, 7 Sep 2006 22:52:01 +0000 (22:52 +0000)
Thu, 7 Sep 2006 22:52:01 +0000 (22:52 +0000)
commit 893632be4e17ccd791cfda17d2e99bb2312f6ff8
Clean up logging for extended-query-protocol operations, as per my recent
proposal. Parameter logging works even for binary-format parameters, and
logging overhead is avoided when disabled.

log_statement = all output for the src/test/examples/testlibpq3.c example
now looks like

LOG: statement: execute <unnamed>: SELECT * FROM test1 WHERE t = 1ドル
DETAIL: parameters: 1ドル = 'joe''s place'
LOG: statement: execute <unnamed>: SELECT * FROM test1 WHERE i = 1ドル::int4
DETAIL: parameters: 1ドル = '2'

and log_min_duration_statement = 0 results in

LOG: duration: 2.431 ms parse <unnamed>: SELECT * FROM test1 WHERE t = 1ドル
LOG: duration: 2.335 ms bind <unnamed> to <unnamed>: SELECT * FROM test1 WHERE t = 1ドル
DETAIL: parameters: 1ドル = 'joe''s place'
LOG: duration: 0.394 ms execute <unnamed>: SELECT * FROM test1 WHERE t = 1ドル
DETAIL: parameters: 1ドル = 'joe''s place'
LOG: duration: 1.251 ms parse <unnamed>: SELECT * FROM test1 WHERE i = 1ドル::int4
LOG: duration: 0.566 ms bind <unnamed> to <unnamed>: SELECT * FROM test1 WHERE i = 1ドル::int4
DETAIL: parameters: 1ドル = '2'
LOG: duration: 0.173 ms execute <unnamed>: SELECT * FROM test1 WHERE i = 1ドル::int4
DETAIL: parameters: 1ドル = '2'

(This example demonstrates the folly of ignoring parse/bind steps for duration
logging purposes, BTW.)

Along the way, create a less ad-hoc mechanism for determining which commands
are logged by log_statement = mod and log_statement = ddl. The former coding
was actually missing quite a few things that look like ddl to me, and it
did not handle EXECUTE or extended query protocol correctly at all.

This commit does not do anything about the question of whether log_duration
should be removed or made less redundant with log_min_duration_statement.
doc/src/sgml/config.sgml diff | blob | blame | history
src/backend/commands/portalcmds.c diff | blob | blame | history
src/backend/commands/prepare.c diff | blob | blame | history
src/backend/executor/spi.c diff | blob | blame | history
src/backend/tcop/postgres.c diff | blob | blame | history
src/backend/tcop/utility.c diff | blob | blame | history
src/backend/utils/mmgr/README diff | blob | blame | history
src/backend/utils/mmgr/portalmem.c diff | blob | blame | history
src/include/tcop/utility.h diff | blob | blame | history
src/include/utils/portal.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /