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 1wH7ls-006srE-1C for pgsql-general@arkaria.postgresql.org; Sun, 26 Apr 2026 22:16:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wH7lr-00BFlc-1q for pgsql-general@arkaria.postgresql.org; Sun, 26 Apr 2026 22:16:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wH7lr-00BFlT-0K for pgsql-general@lists.postgresql.org; Sun, 26 Apr 2026 22:16:11 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wH7lo-00000002von-3uNx for pgsql-general@lists.postgresql.org; Sun, 26 Apr 2026 22:16:10 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-479ef2b7979so4115383b6e.3 for ; Sun, 26 Apr 2026 15:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777241768; cv=none; d=google.com; s=arc-20240605; b=gds1dz8VrynO1Dxna1cp9DHU+x3Zi9RgOrGBNECg95/VvSWg4GjAKFHr73LBRB1r38 EuuxL/ZqezU7sYZdsfHc0NnyX/6KESDNa3ymJYvSV7LNmKCxD9RfeYzNtI256FbJnWRy nAM0RKsRJ7L9xO75hD4UAtsjfWHaiGNZ19stpTECHFJpmwerV00jKy+0u+X4JyukTyAp zw6ASOq+tSVQzGQftl8/iHcMCAJNHOG2Melqc51mvxM6Vhww2anCTXnhC074zaEu9BFn vdbsl9WKTdjmxu47I/jI1nbsr1UCb47RwbyRPiXsYobf283ah1q+gRa8VpSJJ3sU20dq w/nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=NmsRDLY2NqP71wbInNzGOJfThlB2n74voYXWOJmslBw=; fh=JEugTb/7o4SDF7NEEnMosZWbSQpNEa80IRDF3apuFVo=; b=FAwDQlKBGWxDWDoFEn0HOLlTb4g7Xq5BUjnzPfWBxDkOxMiPr2Y2yjRjnHnJA1Vah1 fjPt9ZTgnH2NivzaoUS46Cxdd1/KD5UEh2YbRm1exGYG+EIi41pewz13JLMB17lFFx9T oyMSftllHaWialWqrHdb/eH5CE1ugcz7U3GLrdpkRv+rRVYIpTsG/1MouUl6p0LcipPV 0Di1wSh3F905AqGmtPMZyd4iXMuU27JUK+0MbGrBTWg+s9zAgqKFtYq7BD8WhZF0Bctd hqNENsiFvw2O0UXY8I1tWiseaATRpUw+yk9XSUX3K9OtfZnUA+V54TUwFqf2CryXSKQp bgQQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777241768; x=1777846568; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NmsRDLY2NqP71wbInNzGOJfThlB2n74voYXWOJmslBw=; b=DRWTYAssxKnZVYMa15NP7jOYQ3RSU6Yk8NU4Ds4pnpdjWn6iB5oavHjbZG7W1CRUnR Dzv02BlZec33RABzu2vSX90OTD2pUduIZXsSZAKCQD/9WPUnpj2ovtVMZnNm+3UOODS+ TNLHr8RT8wy4WLg0L2Lw+XYmehnYDPi71xM0Ge6fRn4Kjb4VGMojaCpX5UAgIdv+7v+T pZuT8Ceh/iHNBQNU02jphnMKuBROH6myEGbPM8Cksxx13P0suBWQfo3sGwDaVJAUDuk/ P+5i/2forWmZyqKH9+NJH2zGouPqLxymPrbXlL1suZYVhgAz/mhYWffTDbYzAq3pub39 74BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777241768; x=1777846568; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NmsRDLY2NqP71wbInNzGOJfThlB2n74voYXWOJmslBw=; b=Z4FzBFiBTreRdKFPUw22TxsjFJAkRXYdO3mfQpDKdfkm0DuDIg40sGVGkP/f/MESf3 y1/n8jhLcyZgwY7qQHwac8vkjG4HeSAF8qIe7GBxK1ZTpl9QVPGZxLGq7ECrSiEkmdsD vpmSfCt5+OZ3QKS5D/ukLIOvEmrxu8MvWUHc1KGoFcUiPiCux/xoQ+lBuKypKglTr+C7 gqb6APzgDiem0gm0sMre9rsED5XaN0oEY19Gi0qwP0DCmE5zbtln+EcYZoQ+kb/HgUsH My2MTT+8tyGqDr2SQDl2k2Cxu2s5kM2Z+H8pIlYWcQu34UuBrwhBQSQ62oB+o17IeEWE ggOA== X-Forwarded-Encrypted: i=1; AFNElJ9HNFA/hnqi6STIm1oDs3i1yWyK/J6cdAWB5Hq2yQwP+vqhj4/qbyrxtkHSHWiu1aB7lF7IVsnaCDhf7pGy@lists.postgresql.org X-Gm-Message-State: AOJu0YwARGL7+G99U3+2+aZPbuprGi2gcOtFP0bqR8GClQtDuiEtZzZJ J+XUZj2tqPr9d9vIUNuwexXo1O7UfGedbvOxwZ7fNXQCxQg12G/iUdoEre9udbXBZjt/34btaRM YnRw9TdTgdIntk3nidr+kHmhSkvjmywwg8Q== X-Gm-Gg: AeBDieskBqHHpSmOj53efVlzhbZ8/QZR3kkEdEVUFdIXMuVhTiRUXP3L6tLYUE38CnY T2NpGw0mhX/aJGn2BTI6uoD3eiQJXPsGvB8RmIoo2kwxFenrmOyl+ClTGnSQR9YVxtgciLLP9M4 LYFuY6F71hwCgPmcT6D0vmiC1dhfPBF+QI/V0zpSLrVr+KrjsHbmkCxLOWpGTV5yDNfgGF1PJpA d8ZYyoXUKJT/FVIHVQPGhwIG8DgEVrDxpF/Hfvwqq+g3THXePDdZY8W4Jj6StPT997437dQtM7t C5lsJtzz9XbicRp7E5s= X-Received: by 2002:a05:6808:3185:b0:479:d779:353e with SMTP id 5614622812f47-479d7793951mr18212229b6e.24.1777241768523; Sun, 26 Apr 2026 15:16:08 -0700 (PDT) MIME-Version: 1.0 References: <082a4816-1f4a-4f52-bef6-97c194eebad6@aklaver.com> In-Reply-To: From: Ron Johnson Date: Sun, 26 Apr 2026 18:15:58 -0400 X-Gm-Features: AQROBzASoVpwJVnubdmeyWX_isIilbf_o5BMHsbBEgfV8GYwpGe1q6f12uDImKk Message-ID: Subject: Re: Why that query fails? To: Igor Korot Cc: Adrian Klaver , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000004afa18065064583f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004afa18065064583f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When in doubt, run the query interactively. On Sun, Apr 26, 2026 at 6:06=E2=80=AFPM Igor Korot wro= te: > Adrian, > > On Sun, Apr 26, 2026 at 3:38=E2=80=AFPM Igor Korot w= rote: > > > > Adrian, > > > > On Sun, Apr 26, 2026 at 3:34=E2=80=AFPM Igor Korot = wrote: > > > > > > Adrian, > > > > > > On Sun, Apr 26, 2026 at 3:22=E2=80=AFPM Adrian Klaver < > adrian.klaver@aklaver.com> wrote: > > > > > > > > On 4/26/26 1:15 PM, Igor Korot wrote: > > > > > Hi, ALL, > > > > > [quote] > > > > > Thread 1 "dbhandler" hit Breakpoint 1, > > > > > > > > > 66 errorMsg.push_back( L"Error executing query: " = + > err ); > > > > > (gdb) p err > > > > > $2 =3D L"ERROR: invalid byte sequence for encoding \"UTF8\": > > > > > > > > I would think the above is a clue. > > > > > > > > Are you sure the value you are passing to the parameter is UTF8? > > > > > > Positive. > > > > > > This is what the following line should be doing: > > > > > > [code] > > > 57 strcpy( values[0], m_pimpl->m_myconv.to_bytes( > > > name.c_str() ).c_str() ); > > > [/code] > > > > And the conversion is as follows: > > > > [code] > > std::wstring_convert > m_myconv; > > [/code] > > > > Thank you. > > Those are the values from gdb: > > [code] > (gdb) p values[0] > $1 =3D 0x603001613380 "test" > (gdb) p strlen(values[0]) > $2 =3D 4 > (gdb) > [/code] > > Thank you. > > > > > > > > > Thank you. > > > > > > > > > > > > 0x00\nCONTEXT: unnamed portal parameter $1\n" > > > > > (gdb) > > > > > [/quote] > > > > > > > > > > What am I doing wrong? > > > > > > > > > > Thank you. > > > > > > > > > > > > > > > > > > > > > > -- > > > > Adrian Klaver > > > > adrian.klaver@aklaver.com > > > --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000004afa18065064583f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When in doubt, run the query interactively.

On Sun, Apr 26, 2026 at 6:06=E2=80=AFPM Igor Korot <ikorot01@gmail.com> wrote:
Adrian,

On Sun, Apr 26, 2026 at 3:38=E2=80=AFPM Igor Korot <ikorot01@gmail.com> wrote:
>
> Adrian,
>
> On Sun, Apr 26, 2026 at 3:34=E2=80=AFPM Igor Korot <ikorot01@gmail.com> wrote:<= br> > >
> > Adrian,
> >
> > On Sun, Apr 26, 2026 at 3:22=E2=80=AFPM Adrian Klaver <adrian.klaver@aklav= er.com> wrote:
> > >
> > > On 4/26/26 1:15 PM, Igor Korot wrote:
> > > > Hi, ALL,
> > > > [quote]
> > > > Thread 1 "dbhandler" hit Breakpoint 1,
> > >
> > > > 66=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 errorMsg.push_back( L"Error executing query: " + err );
> > > > (gdb) p err
> > > > $2 =3D L"ERROR:=C2=A0 invalid byte sequence for en= coding \"UTF8\":
> > >
> > > I would think the above is a clue.
> > >
> > > Are you sure the value you are passing to the parameter is U= TF8?
> >
> > Positive.
> >
> > This is what the following line should be doing:
> >
> > [code]
> > 57=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 strcpy( values[0], m_= pimpl->m_myconv.to_bytes(
> > name.c_str() ).c_str() );
> > [/code]
>
> And the conversion is as follows:
>
> [code]
>=C2=A0 =C2=A0 =C2=A0std::wstring_convert<std::codecvt_utf8<wchar_= t> > m_myconv;
> [/code]
>
> Thank you.

Those are the values from gdb:

[code]
(gdb) p values[0]
$1 =3D 0x603001613380 "test"
(gdb) p strlen(values[0])
$2 =3D 4
(gdb)
[/code]

Thank you.

>
> >
> > Thank you.
> >
> > >
> > > > 0x00\nCONTEXT:=C2=A0 unnamed portal parameter $1\n"= ;
> > > > (gdb)
> > > > [/quote]
> > > >
> > > > What am I doing wrong?
> > > >
> > > > Thank you.
> > > >
> > > >
> > >
> > >
> > > --
> > > Adrian Klaver
> > > adrian.klaver@aklaver.com




--
Death to <Redacted>, and butter sauce.Don't boil me, I'm still alive.
<Redacted> lobs= ter!
--0000000000004afa18065064583f--