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 1tpeO8-009eCy-JM for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 02:21:36 +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 1tpeO6-00FOkR-T3 for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 02:21:34 +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.94.2) (envelope-from ) id 1tpeO6-00FOkH-Hu for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 02:21:34 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tpeO4-0011Gn-2d for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 02:21:33 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-6fd5f8f3e8eso27332477b3.0 for ; Tue, 04 Mar 2025 18:21:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741141292; x=1741746092; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=cUPKmhm9vNgsDY2CeJOCuDXpJkTGo7FI7AQsIzJnJzo=; b=NzrXJecxWuT1Ds5gE5V0qgHE0C4X73Vguo9gv5OCG+P3ih+VwqINXrESpAbKfPuDxS teIbDmqQ6r8IYE02O6QDmQHs3gcfaVpxqKsvXe1GxP5E2FtaB8UjAzUyTZ19dctbUaB7 4rs1UOT/yzG/l3PWtLAFd+HKYT51faBUq/lNVIl+fBTJXuzEus1tG5o4myvrVtkq+QT4 jcrUfGnJLhrnrQdhfbqlOGNHBb11Xm69pJeylcb8VMMI1mtHEzztC6NrN+0eVFFsFtwz drygIh6bm0wmRWn3DuTOu2+gEOawR6+/PJS5kT63DxMmxIX5Fss5wEXIOFgHNNn47XiH 7gOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741141292; x=1741746092; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cUPKmhm9vNgsDY2CeJOCuDXpJkTGo7FI7AQsIzJnJzo=; b=EvAtiAJvTUwxZziaN8NwymZ3DyyuFVc+SqYxI4OK/MRbzRzzo4A36ItCXW70+NlbZ+ p4pyjZX/gxeeyVj9O2Scmh7wibLtV8/ASi+SrAdjJHd5xXui0lLWSx1BAc6dK8xVoJ+v VLuY3zhAXtsfimwZ1K+WYkSW5LbWlPOrlwJ+A9aga+wG81WLXJCDMNHdYQwCCb4ceMlv uJra3BxDbRzHAVYjPA9Fi414t5lgUPDAVu/K4kQ7SkmyWR1K/j6hq30aj1UQJqtB8UpG GKd6Cx72LZc6PznOihMfvLpmDrrgzbsyi0YL85YqZHm49v/qjC638bdY9W78lI3s6dfF 34gw== X-Gm-Message-State: AOJu0YwtPxjdDZsjXQx4B6eO0734Zx9S3pRgrNBKLR7e3+1hwDcPU3iV NLgpEOqfNXOe2fUfnVvcboDLa1dDuThdjTEYlBsSitMQv3Xz8zG3+bvN/GIRNuc6ZKMf++tHlX0 py8S21kZnmpYV6Ny5SxgITiQCE9MdVCxr X-Gm-Gg: ASbGnctrZU0cCN902ec4+xew0s7Ovicz8e1K8+ddFTqi3Qu9aRCy0ssJq4pIpswX/eg CWOWc54b8xSrOF4Z62829QtqnTwBnoPLKIEVxQ5Ctl4E70VVLokQO8Jt3y9S+BBmmKu6l3/Hyv4 L9Yj8ji4d/F9uUwoUHe/8T3QIVFmmLZsWQ9gM1IA== X-Google-Smtp-Source: AGHT+IF9lqb8Dfjf2WDQMrrUdSJSrOQT2F9JKOowFDr6Jh+PlX9XLy0VB6tYYa66/BfZcc1yUE10uHO/SaUvHHfkE4w= X-Received: by 2002:a05:690c:7207:b0:6fb:a4e6:7d52 with SMTP id 00721157ae682-6fda3192f66mr28706097b3.35.1741141292141; Tue, 04 Mar 2025 18:21:32 -0800 (PST) MIME-Version: 1.0 From: Igor Korot Date: Wed, 5 Mar 2025 01:42:13 -0600 X-Gm-Features: AQ5f1Jpda8ZNjDwb3S5Bx20s6USbVgU3k58dTqqYZFcCEECjgafrZHd8ch12rL4 Message-ID: Subject: Error on query execution To: "pgsql-generallists.postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, ALL, [code] type = 80; uint32_t binaryIntVal; const char *paramValues[1]; int paramLengths[1]; int paramFormats[1]; binaryIntVal = htonl( (uint32_t) type ); paramValues[0] = (char *) &binaryIntVal; paramLengths[0] = sizeof( binaryIntVal ); paramFormats[0] = 1; res = PQexecParams( m_db, "SELECT * FROM abcatfmt WHERE abf_type = $1", 1, nullptr, paramValues, paramLengths, paramFormats, 1 ); if (PQresultStatus(res) != PGRES_TUPLES_OK) { std::wstring err = m_pimpl->m_myconv.from_bytes( PQerrorMessage( m_db ) ); errorMsg.push_back( L"Error executing query: " + err ); result = 1; } [/code] Running the above I'm getting: [quote] (gdb) p err $1 = L"ERROR: incorrect binary data format in bind parameter 1\n" [/quote] What is wrong and how do I fix it? Thank you.