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

Re: [NOOB] try tu put a number with pqexecprepare

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "elekis" <elekis(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [NOOB] try tu put a number with pqexecprepare
Date: 2008-11-28 10:23:45
Message-ID: bce3a367-b0cc-406e-8d40-2e8cdd8a0eea@mm (view raw or flat)
Thread:
Lists: pgsql-general
	elekis wrote:

> I put the code here
> 
> http://pastebin.com/m1860cc27
> 
> 
> I symply try to put the number 5 for the second column, and after 
that
> read the line.
> 
> 
> but the database, I have taht
> 83886080 in place of 5.

83886080 happens to be ntohl(5), it's probably not a coincidence :)

Since  you're using binary format for your integer parameters, you must 
convert them from host byte order to network byte order with htonl() 
and conversely use ntohl() for results.

 Best regards,
-- 
 Daniel
 PostgreSQL-powered mail user agent and storage: 
http://www.manitou-mail.org

In response to

Responses

pgsql-general by date

Next:From: elekisDate: 2008-11-28 10:40:54
Subject: Re: [NOOB] try tu put a number with pqexecprepare
Previous:From: Abdul RahmanDate: 2008-11-28 10:11:34
Subject: Re: PgAgent Job Scehduler is NOT running

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