From: Nikita Glukhov <n.gluhov@postgrespro.ru>
To: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: a.lubennikova@postgrespro.ru
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: Cast jsonb to numeric, int, float, bool
Date: Thu, 2 Feb 2017 02:02:17 +0300
Message-ID: <8ad4288a-b6b4-d799-2887-c94e5c3c69f3@postgrespro.ru> (raw)
In-Reply-To: <6e36f08b-0fa5-445e-55bc-654b9afb7f04@BlueTreble.com>
References: <0154d35a-24ae-f063-5273-9ffcdf1c7f2e@postgrespro.ru>
<55137679-fd6b-baf0-bfbf-6558ce5cb409@postgrespro.ru>
<6e36f08b-0fa5-445e-55bc-654b9afb7f04@BlueTreble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 02.02.2017 01:07, Jim Nasby wrote:
> On 2/1/17 8:26 AM, Nikita Glukhov wrote:
>> Some comments about the code: I think it would be better to
>> * add function for extraction of scalars from pseudo-arrays
>> * iterate until WJB_DONE to pfree iterator
>
> I'm not sure what your intent here is, but if the idea is that a json array
> would magically cast to a bool or a number data type I think that's a bad idea.
My idea, of course, is not about casting any json array to a scalar. It is only
about helper subroutine for extraction of top-level jsonb scalars that are always
stored as one-element pseudo-arrays with special flag F_SCALAR in the array header.
--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: n.gluhov@postgrespro.ru, Jim.Nasby@BlueTreble.com, a.lubennikova@postgrespro.ru
Subject: Re: Cast jsonb to numeric, int, float, bool
In-Reply-To: <8ad4288a-b6b4-d799-2887-c94e5c3c69f3@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox