X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 756D952865 for ; Sat, 4 Jun 2005 10:53:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 53310-01 for ; Sat, 4 Jun 2005 13:52:58 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.195]) by svr1.postgresql.org (Postfix) with ESMTP id A1BDF5285B for ; Sat, 4 Jun 2005 10:52:57 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 71so952930wra for ; Sat, 04 Jun 2005 06:53:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=p/7GDIlZuHKFQa/13tZLjXVL7lCG3m+GFEW2uVthWON13QOxnoudQlwh+I87ktcMzevdf86p0O67aqs74m71PQkwrhFSEXAglmpPhJzX6R4K1Ryn+fOWGz6p4tjB4Ek8t5XxgqOo7VT6RaE2gAPin414mK8ohExa8TFOsLbFoMY= Received: by 10.54.26.62 with SMTP id 62mr1966341wrz; Sat, 04 Jun 2005 06:52:27 -0700 (PDT) Received: by 10.54.30.45 with HTTP; Sat, 4 Jun 2005 06:52:27 -0700 (PDT) Message-ID: <7104a737050604065267a108b@mail.gmail.com> Date: Sat, 4 Jun 2005 16:52:27 +0300 From: Volkan YAZICI Reply-To: Volkan YAZICI To: Daniel Verite Subject: Re: libpq, PQExecParams and the inserting of binary data Cc: pgsql-interfaces@postgresql.org In-Reply-To: <20050604153734.8397528@uruguay> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <7104a73705060401222c6cc5d2@mail.gmail.com> <20050604153734.8397528@uruguay> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.163 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200506/21 X-Sequence-Number: 5589 Hi, On 6/4/05, Daniel Verite wrote: > Are you passing a NULL pointer in paramLengths? You need to > pass an array containing the actual length of your binary data. Yes, paramLengthts is a NULL pointer. But, is SegFault an expected result? Himms... When I take a look at src/interfaces/libpq/fe-exec.c: 956 if (paramValues && paramValues[i]) 957 { 958 int nbytes; 960 if (paramFormats && paramFormats[i] !=3D 0) 961 { 962 /* binary parameter */ 963 nbytes =3D paramLengths[i]; It appears to be SegFault was caused by paramLengths[i] on line 963. So, this means, user _has_to_ specify the size of input while using binary data. Maybe a "if ( paramLengths )" check can be useful. Regards.