htonl necesssary for PQexecParams input?

From: Kevin Jenkins <gameprogrammer(at)rakkar(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: htonl necesssary for PQexecParams input?
Date: 2006-06-22 15:52:04
Message-ID: 449ABCA4.2070209@rakkar.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Previously I was getting a bad result when calling PQexecParams with
binary results because PostgreSQL stores its data big endian. So I
had to do ntohl on the result to get it to little endian.

My question is, do I also need to do htonl then, as in this scenario?

outStr[0]="blah";
outLengths[0]=htonl((int)strlen("blah"));
formats[0]=1;
PQexecParams(pgConn, query,1,0,outStr,outLengths,formats,1);

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-06-22 15:56:53 Re: VACUUM hanging on idle system
Previous Message Tom Lane 2006-06-22 15:49:31 Re: Unable to start pg service