Re: Question on libpq parameters - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Question on libpq parameters
Date
Msg-id b42b73150812010621v18ce5abdl6ef402f190102716@mail.gmail.com
Whole thread Raw
In response to Install question on Mac Leopard Server 10.5  (Steve Henry <steve@sdmacit.com>)
List pgsql-general
On Mon, Dec 1, 2008 at 12:10 AM, Owen Hartnett <owen@clipboardinc.com> wrote:
> At 1:26 PM -0500 11/30/08, Tom Lane wrote:
>>
>> Owen Hartnett <owen@clipboardinc.com> writes:
>>>
>>>  Yes, it did.  I'm confused.  My first parameter is a string, but the
>>>  following two are integers.  I thought the paramType parameter
>>>  indicated the type.  Do the integers need to be sprintf'd to strings?
>>
>> Yes.
>>
>> Alternatively, you could pass the integers as binary, but that's not
>> notation-free either (you need htonl or some such).
>>
>>                        regards, tom lane
>
> Thanks, that did it. I got confused with the binary parameters, and
> PQgetvalue returning the binary through a char * when it returns a binary
> value.

you may want to check out libpqtypes:
http://libpqtypes.esilo.com/
http://pgfoundry.org/projects/libpqtypes/

merlin

pgsql-general by date:

Previous
From: elekis
Date:
Subject: Re: Cannot open include file: 'nodes/nodes.h'
Next
From: Tom Lane
Date:
Subject: Re: Cannot open include file: 'nodes/nodes.h'