diff --git a/docs/documentation/head/connect.md b/docs/documentation/head/connect.md index d80142ee95..052a24b19d 100644 --- a/docs/documentation/head/connect.md +++ b/docs/documentation/head/connect.md @@ -340,7 +340,7 @@ Connection conn = DriverManager.getConnection(url); * **tcpNoDelay** = boolean - Enable or disable TCP nodelay. The default is `false`. + Enable or disable TCP nodelay. The default is `true`. * **unknownLength** = int diff --git a/pgjdbc/src/main/java/org/postgresql/PGProperty.java b/pgjdbc/src/main/java/org/postgresql/PGProperty.java index b637df9368..01e8d0a782 100644 --- a/pgjdbc/src/main/java/org/postgresql/PGProperty.java +++ b/pgjdbc/src/main/java/org/postgresql/PGProperty.java @@ -705,8 +705,8 @@ public enum PGProperty { TCP_NO_DELAY( "tcpNoDelay", - "false", - "Enable or disable TCP no delay. The default is (@code false}." + "true", + "Enable or disable TCP no delay. The default is (@code true}." ), /** * Specifies the length to return for types of unknown length. diff --git a/pgjdbc/src/main/java/org/postgresql/core/PGStream.java b/pgjdbc/src/main/java/org/postgresql/core/PGStream.java index de0b75f420..ee91f6d79f 100644 --- a/pgjdbc/src/main/java/org/postgresql/core/PGStream.java +++ b/pgjdbc/src/main/java/org/postgresql/core/PGStream.java @@ -113,7 +113,7 @@ public PGStream(PGStream pgStream, int timeout ) throws IOException { int receiveBufferSize = 1024; int soTimeout = 0; boolean keepAlive = false; - boolean tcpNoDelay = false; + boolean tcpNoDelay = true; /* Get the existing values before closing the stream