Re: Why that query fails?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: Igor Korot <ikorot01(at)gmail(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Why that query fails?
Date: 2026-04-26 22:59:21
Message-ID: 2423212.1777244361@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Sabino Mullane <htamfids(at)gmail(dot)com> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dilip Kumar 2026-04-27 06:14:55 Re: Support logical replication of DDLs, take2
Previous Message Greg Sabino Mullane 2026-04-26 22:17:04 Re: Why that query fails?