pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonah H. Harris <jonah.harris@gmail.com>
To: clarkhorse@clarktx.com
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Newbie problem with from database in C
Date: Sun, 18 May 2008 21:52:39 -0400
Message-ID: <36e682920805181852v1819b5aeqb554c47bc9ecbacb@mail.gmail.com> (raw)
In-Reply-To: <W5749323096104921211159632@webmail12>
References: <W5749323096104921211159632@webmail12>

On Sun, May 18, 2008 at 9:13 PM,  <clarkhorse@clarktx.com> 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/



view thread (5+ messages)  latest in thread

Message-ID: <36e682920805181852v1819b5aeqb554c47bc9ecbacb@mail.gmail.com>
Permalink:  ../36e682920805181852v1819b5aeqb554c47bc9ecbacb@mail.gmail.com/
Also on:    postgresql.org/message-id/36e682920805181852v1819b5aeqb554c47bc9ecbacb@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jonah.harris@gmail.com, clarkhorse@clarktx.com
  Subject: Re: Newbie problem with from database in C
  In-Reply-To: <36e682920805181852v1819b5aeqb554c47bc9ecbacb@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox