Skip site navigation (1) Skip section navigation (2)

Re: Newbie problem with from database in C

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: clarkhorse(at)clarktx(dot)com
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Newbie problem with from database in C
Date: 2008-05-19 01:52:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
On Sun, May 18, 2008 at 9:13 PM,  <clarkhorse(at)clarktx(dot)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(dot)harris(at)enterprisedb(dot)com
Edison, NJ 08837 |

In response to

pgsql-interfaces by date

Next:From: Dennis WangDate: 2008-05-19 05:53:58
Subject: Re: pg_subtrans directory grows over 1 GB, is there a way to control it?
Previous:From: clarkhorseDate: 2008-05-19 01:13:52
Subject: Newbie problem with from database in C

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group