diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
index e3e75c1e19d868a1c851ac4441dc7ff2971baa42..ddec830c4c62f96a5b433899d2ba404db2515561 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
@@ -13,7 +13,7 @@ import org.postgresql.largeobject.*;
 import org.postgresql.util.PGbytea;
 import org.postgresql.util.PSQLException;
 
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1ResultSet.java,v 1.3 2002/08/14 20:35:39 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1ResultSet.java,v 1.4 2002/08/16 17:51:38 barry Exp $
  * This class defines methods of the jdbc1 specification.  This class is
  * extended by org.postgresql.jdbc2.AbstractJdbc2ResultSet which adds the jdbc2
  * methods.  The real ResultSet class (for jdbc1) is org.postgresql.jdbc1.Jdbc1ResultSet
@@ -851,9 +851,10 @@ public abstract class AbstractJdbc1ResultSet
 
 			// If first time, create the buffer, otherwise clear it.
 			if (rs.sbuf == null)
-				rs.sbuf = new StringBuffer();
-			else
+				rs.sbuf = new StringBuffer(32);
+			else {
 				rs.sbuf.setLength(0);
+			}
 
 			// Copy s into sbuf for parsing.
 			rs.sbuf.append(s);
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
index 96a50efa8fa5e8e76dee9df416e2640bf8c79b82..fc532fcc8be3a0079da47acdae90145adb8ef4fa 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
@@ -8,7 +8,7 @@ import java.util.Vector;
 import org.postgresql.largeobject.*;
 import org.postgresql.util.*;
 
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.3 2002/07/25 22:45:27 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.4 2002/08/16 17:51:38 barry Exp $
  * This class defines methods of the jdbc1 specification.  This class is
  * extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
  * methods.  The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
@@ -40,7 +40,7 @@ public abstract class AbstractJdbc1Statement implements org.postgresql.PGStateme
 	private static final short ESC_TIMEDATE = 3;
 
 	// Some performance caches
-	private StringBuffer sbuf = new StringBuffer();
+	private StringBuffer sbuf = new StringBuffer(32);
 
         //Used by the preparedstatement style methods
 	protected String sql;
@@ -498,7 +498,7 @@ public abstract class AbstractJdbc1Statement implements org.postgresql.PGStateme
 	{
 		// Since escape codes can only appear in SQL CODE, we keep track
 		// of if we enter a string or not.
-		StringBuffer newsql = new StringBuffer();
+		StringBuffer newsql = new StringBuffer(sql.length());
 		short state = IN_SQLCODE;
 
 		int i = -1;
@@ -736,6 +736,7 @@ public abstract class AbstractJdbc1Statement implements org.postgresql.PGStateme
 			synchronized (sbuf)
 			{
 				sbuf.setLength(0);
+                                sbuf.ensureCapacity(x.length());
 				int i;
 
 				sbuf.append('\'');
@@ -852,6 +853,7 @@ public abstract class AbstractJdbc1Statement implements org.postgresql.PGStateme
 			synchronized (sbuf)
 			{
 				sbuf.setLength(0);
+                                sbuf.ensureCapacity(32);
 				sbuf.append("'");
                                 //format the timestamp
                                 //we do our own formating so that we can get a format
diff --git a/src/interfaces/jdbc/org/postgresql/util/PGbytea.java b/src/interfaces/jdbc/org/postgresql/util/PGbytea.java
index 93e8afae5ae0dd6bde6deb57cb339447a1ff11e1..a6d1c011bf54e8e0fc0176b1dd49e9ed36d30cd0 100644
--- a/src/interfaces/jdbc/org/postgresql/util/PGbytea.java
+++ b/src/interfaces/jdbc/org/postgresql/util/PGbytea.java
@@ -5,7 +5,7 @@ import java.sql.*;
 /*
  * Converts to and from the postgresql bytea datatype used by the backend.
  *
- * $Id: PGbytea.java,v 1.4 2002/01/05 22:26:23 barry Exp $
+ * $Id: PGbytea.java,v 1.5 2002/08/16 17:51:38 barry Exp $
  */
 
 public class PGbytea
@@ -62,7 +62,7 @@ public class PGbytea
 	{
 		if (p_buf == null)
 			return null;
-		StringBuffer l_strbuf = new StringBuffer();
+		StringBuffer l_strbuf = new StringBuffer(p_buf.length);
 		for (int i = 0; i < p_buf.length; i++)
 		{
 			int l_int = (int)p_buf[i];