From: | Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it> |
---|---|
To: | Igor Korot <ikorot01(at)gmail(dot)com> |
Cc: | PostgreSQL General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Results interpretation |
Date: | 2017-08-18 20:15:47 |
Message-ID: | CAHjZ2x6MOcJ_8f6dYA7zEU-yKKDsJcroBzCVtNVmCQ7EmcjSGQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Il 18 ago 2017 21:59, "Vincenzo Romano" <vincenzo(dot)romano(at)notorand(dot)it> ha
scritto:
Il 18 ago 2017 21:08, "Igor Korot" <ikorot01(at)gmail(dot)com> ha scritto:
Hi, Vincenzo,
On Fri, Aug 18, 2017 at 2:52 PM, Vincenzo Romano
<vincenzo(dot)romano(at)notorand(dot)it> wrote:
> What I can tell you is not more of what is in the documentation.
>
> https://www.postgresql.org/docs/9.6/static/libpq-exec.html#L
IBPQ-EXEC-SELECT-INFO
>
>
> In particular see the function PQBinaryTuples.
OK.
I was looking at PQexec() vs. PQexecParam(), where the latter says:
[quote]
.... and query results can be requested in either text or binary format.
....
[/quote]
and the former doesn't mention anything like this.
Thank you.
So far I've never seen binary results. I presume you can get one with
BLOB/BYTEA columns.
Even in those cases I think you can skip the test and use the PQfsize
function in order to use the data pointer from PQgetvalue as a binary
buffer.
But, I repeat, I've never seen binary data so far.
In those cases you'd first check whether the result contains any binary
data.
>
> --
> Vincenzo Romano - NotOrAnd.IT
> Information Technologies
> --
> NON QVIETIS MARIBVS NAVTA PERITVS
>
> Il 18 ago 2017 20:45, "Igor Korot" <ikorot01(at)gmail(dot)com> ha scritto:
>>
>> Hi, Vincenzo,
>>
>> On Fri, Aug 18, 2017 at 1:51 PM, Vincenzo Romano
>> <vincenzo(dot)romano(at)notorand(dot)it> wrote:
>> > Afaik, pgresult structure and it's fields are not meant to be handled
>> > directly apart of comparing the pointer to null.
>>
>> So if I want to get an integer value with PQgetValue() I don't need to
>> do anything?
>> I.e. no ntoh() call?
>>
>> Thank you.
>>
>> >
>> >
>> >
>> > --
>> > Vincenzo Romano - NotOrAnd.IT
>> > Information Technologies
>> > --
>> > NON QVIETIS MARIBVS NAVTA PERITVS
>> >
>> > Il 18 ago 2017 19:46, "Igor Korot" <ikorot01(at)gmail(dot)com> ha scritto:
>> >>
>> >> Hi,
>> >> I looked at the documentation, but couldn't find it.
>> >>
>> >> If I do PQexec() call, the results will be interpreted as binary or
>> >> text?
>> >>
>> >> I'm trying to get an int field from the query and wonder if I need to
>> >> do
>> >> hton() call or not?
>> >>
>> >> Thank you.
>> >>
>> >>
>> >> --
>> >> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> >> To make changes to your subscription:
>> >> http://www.postgresql.org/mailpref/pgsql-general
From | Date | Subject | |
---|---|---|---|
Next Message | twoflower | 2017-08-18 20:35:51 | Re: archive_command fails but works outside of Postgres |
Previous Message | Vincenzo Romano | 2017-08-18 19:59:50 | Re: Results interpretation |