Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qgQgZ-00FoFg-TN for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Sep 2023 14:17:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qgQgY-000Kti-8Z for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Sep 2023 14:17:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qgQgX-000KtW-WD for pgsql-bugs@lists.postgresql.org; Wed, 13 Sep 2023 14:17:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qgQgT-004r9R-CW for pgsql-bugs@lists.postgresql.org; Wed, 13 Sep 2023 14:17:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38DEHSpF2961696; Wed, 13 Sep 2023 10:17:28 -0400 From: Tom Lane To: =?utf-8?B?5aec5qKm5rSL?= cc: pgsql-bugs@lists.postgresql.org Subject: =?UTF-8?Q?Re:_the_same_time_value_return_different_values?= =?UTF-8?Q?=EF=BC=8Cis_it_a_problem?= In-reply-to: <9831C223-91ED-43FC-8223-B90C46BA77C4@icloud.com> References: <9831C223-91ED-43FC-8223-B90C46BA77C4@icloud.com> Comments: In-reply-to =?utf-8?B?5aec5qKm5rSL?= message dated "Wed, 13 Sep 2023 15:24:14 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2961694.1694614648.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 13 Sep 2023 10:17:28 -0400 Message-ID: <2961695.1694614648@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?utf-8?B?5aec5qKm5rSL?=3D writes: > I find the time type accuracy of the database. Using PreparedStatement,= the accuracy found out for the sixth time is different from the first fiv= e times. This number is exactly the same as the threshold of the PreparedS= tatement. I can understand that the database can optimize PreparedStatemen= ts and reduce repeated parsing and other unnecessary operations. but I don= =E2=80=99t quite understand how such processing will affect the execution = results(Or maybe I don=E2=80=99t have a deep understanding of PreparedStat= ement.). If you're using JDBC, this is probably the same effect discussed at https://www.postgresql.org/message-id/flat/CAKyg5Sj%3D85niw8%3DZhX-quHaCQT= PhG40REi1s%2BHYF6Snz4Dfi7Q%40mail.gmail.com It's got something to do with retrieving the query results in binary mode instead of text. The query result at the server is the same, but the JDBC driver is rendering it differently. regards, tom lane