postgresql-jdbc.git / summary / log / commit / refs
commit 27e856ca172c7f55f09db7faed2e5d2f85390400
Author: Kris Jurka <books@ejurka.com>
Date: Thu Jul 22 21:21:44 2010 +0000
Improve protocol logging of copy messages.
org/postgresql/core/v3/QueryExecutorImpl.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/org/postgresql/core/v3/QueryExecutorImpl.java b/org/postgresql/core/v3/QueryExecutorImpl.java
index 691615b8..da628806 100644
--- a/org/postgresql/core/v3/QueryExecutorImpl.java
+++ b/org/postgresql/core/v3/QueryExecutorImpl.java
@@ -4,7 +4,7 @@
* Copyright (c) 2004, Open Cloud Limited.
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/core/v3/QueryExecutorImpl.java,v 1.47 2009/12/07 22:03:06 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/core/v3/QueryExecutorImpl.java,v 1.48 2010/03/21 07:13:37 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@@ -714,6 +714,9 @@ public class QueryExecutorImpl implements QueryExecutor {
byte buf[] = Utils.encodeUTF8(sql);
try {
+ if (logger.logDebug())
+ logger.debug(" FE=> Query(CopyStart)");
+
pgStream.SendChar('Q');
pgStream.SendInteger4(buf.length + 4 + 1);
pgStream.Send(buf);
@@ -813,6 +816,9 @@ public class QueryExecutorImpl implements QueryExecutor {
throw new PSQLException(GT.tr("Tried to end inactive copy"), PSQLState.OBJECT_NOT_IN_STATE);
try {
+ if (logger.logDebug())
+ logger.debug(" FE=> CopyDone");
+
pgStream.SendChar('c'); // CopyDone
pgStream.SendInteger4(4);
pgStream.flush();
@@ -838,7 +844,7 @@ public class QueryExecutorImpl implements QueryExecutor {
throw new PSQLException(GT.tr("Tried to write to an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE);
if (logger.logDebug())
- logger.debug(" FE=> CopyData(" + (siz-off) + ")");
+ logger.debug(" FE=> CopyData(" + siz + ")");
try {
pgStream.SendChar('d');
[parent: 71a476aa5a43]