Re: Accessing structured datatypes using libpq

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Raimo Jormakka <raimo(dot)jormakka(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: Accessing structured datatypes using libpq
Date: 2014-06-11 11:02:49
Message-ID: CAB7nPqQ9pN7AvgopV5s7YEuXVbSjx6aP6_sDnr5rcaZy9a44Vg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 11, 2014 at 6:59 PM, Raimo Jormakka
<raimo(dot)jormakka(at)gmail(dot)com> wrote:
> 2014-06-11 9:44 GMT+03:00 John R Pierce <pierce(at)hogranch(dot)com>:
>
>> On 6/10/2014 11:20 PM, Raimo Jormakka wrote:
>>>
>>>
>>> What is the recommended way of accessing structured data-types
>>> (especially JSONB and HSTORE) using libpq? It seems that by default JSONB
>>> data for example is returned as text.
>>>
>>> Is it not possible to have binary access to these data-types? If it is
>>> possible, then how do I do it exactly as the only thing I get from libpq is
>>> a void-pointer?
>>
>>
>> those are text data types. there is no binary representations.
>
>
> Can someone elaborate this a bit? Isn't the key distinction between the
> JSONB and JSON data-types the fact that the former is a binary format while
> the latter one is text-based?
Internally yes, representation of those data types on disk is
different. However the output result, the one obtained by libpq or any
client is similar in appearance.
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Haas 2014-06-11 13:39:36 Re: [HACKERS] Question about partial functional indexes and the query planner
Previous Message Ravi Kiran 2014-06-11 10:50:27 eclipse-postgres