Re: Question on libpq parameters

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Owen Hartnett" <owen(at)clipboardinc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question on libpq parameters
Date: 2008-12-01 14:21:03
Message-ID: b42b73150812010621v18ce5abdl6ef402f190102716@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 1, 2008 at 12:10 AM, Owen Hartnett <owen(at)clipboardinc(dot)com> wrote:
> At 1:26 PM -0500 11/30/08, Tom Lane wrote:
>>
>> Owen Hartnett <owen(at)clipboardinc(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-12-01 14:26:47 Re: Cannot open include file: 'nodes/nodes.h'
Previous Message elekis 2008-12-01 14:17:46 Re: Cannot open include file: 'nodes/nodes.h'