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.96) (envelope-from ) id 1wH8Ro-006tVt-2t for pgsql-general@arkaria.postgresql.org; Sun, 26 Apr 2026 22:59:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wH8Rn-00BNz4-36 for pgsql-general@arkaria.postgresql.org; Sun, 26 Apr 2026 22:59:31 +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.96) (envelope-from ) id 1wH8Rn-00BNyw-23 for pgsql-general@lists.postgresql.org; Sun, 26 Apr 2026 22:59:31 +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.98.2) (envelope-from ) id 1wH8Rl-00000003EZR-1CiW for pgsql-general@lists.postgresql.org; Sun, 26 Apr 2026 22:59:31 +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 63QMxLia2423213; Sun, 26 Apr 2026 18:59:21 -0400 From: Tom Lane To: Greg Sabino Mullane cc: Igor Korot , "pgsql-generallists.postgresql.org" Subject: Re: Why that query fails? In-reply-to: References: Comments: In-reply-to Greg Sabino Mullane message dated "Sun, 26 Apr 2026 18:17:04 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2423211.1777244361.1@sss.pgh.pa.us> Date: Sun, 26 Apr 2026 18:59:21 -0400 Message-ID: <2423212.1777244361@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Greg Sabino Mullane writes: > You are using binary format, but your length calculation is wrong: > int len1 = (int) name.length() * sizeof( wchar_t ); I think the actual problem is that he's trying to send an array of wchar_t to the server. That is not bit-compatible with UTF-8, even though they are both representations of Unicode. The query string itself has the same problem I think (I believe the L"..." syntax in C produces an array of wchar_t). regards, tom lane