Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 8A2EB2E002F for ; Sun, 18 May 2008 22:52:44 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 14972-04 for ; Sun, 18 May 2008 22:52:35 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by developer.postgresql.org (Postfix) with ESMTP id 11BED2E002C for ; Sun, 18 May 2008 22:52:40 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 3so1032817ywj.73 for ; Sun, 18 May 2008 18:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Ic3KIJNumcd/5jZwOXv+cc5WA9n8/mOnw0XBod44+yE=; b=rfFJKp++tUQIXmt5P3OHFnimSe5hj3irTnyjHY6Qzd69K7sXkj15/EmHp07iYWZTs9ikVd3E12xp9SZnSejdJSdUJ3HWg3riSY2PL/Dcj5V4UPZJ/nJRi9D/cBk8atQzC4fcXieZOjckgnM3D4l2pahnf/HzdttRJVTgWb/gIZ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=j0Cj1I/iXtfpWrEB+y9ZFx0dy6TwJ/56B+NA42+bL6HSKU6Z6XEoNXF+YDQYUKzMHE99DEihBZa9XSYepQ1ogiLkp7gps/wWxZ3ODrHBGi/rzHMY0yHNfMhdOZB8y362LWW0AVo16ZDAlVOBJ8eriGmsQdlVN2zqjunEIfYaYl4= Received: by 10.150.73.41 with SMTP id v41mr5763162yba.186.1211161959683; Sun, 18 May 2008 18:52:39 -0700 (PDT) Received: by 10.150.57.2 with HTTP; Sun, 18 May 2008 18:52:39 -0700 (PDT) Message-ID: <36e682920805181852v1819b5aeqb554c47bc9ecbacb@mail.gmail.com> Date: Sun, 18 May 2008 21:52:39 -0400 From: "Jonah H. Harris" To: clarkhorse@clarktx.com Subject: Re: Newbie problem with from database in C Cc: pgsql-interfaces@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/15 X-Sequence-Number: 6739 On Sun, May 18, 2008 at 9:13 PM, wrote: > characters are fine so far. I have placed the code I am using below. > Would appreciate it if someone could tell me what is wrong or provide me > with a reference on how to do this properly. IIRC, you need to convert from network byte order: idno = ntohl(*((int32 *) PQgetvalue(result, row, 0))); -- Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324 EnterpriseDB Corporation | fax: 732.331.1301 499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com Edison, NJ 08837 | http://www.enterprisedb.com/