pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Nikita Glukhov <n.gluhov@postgrespro.ru>
To: a.lubennikova@postgrespro.ru
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: Cast jsonb to numeric, int, float, bool
Date: Wed, 1 Feb 2017 14:07:50 -0800
Message-ID: <6e36f08b-0fa5-445e-55bc-654b9afb7f04@BlueTreble.com> (raw)
In-Reply-To: <55137679-fd6b-baf0-bfbf-6558ce5cb409@postgrespro.ru>
References: <0154d35a-24ae-f063-5273-9ffcdf1c7f2e@postgrespro.ru>
	<55137679-fd6b-baf0-bfbf-6558ce5cb409@postgrespro.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 2/1/17 8:26 AM, Nikita Glukhov wrote:
>> If you find it useful, I can also add support of json and other types,
>> such as smallint and bigint.
>
> Yes, I'd like to have support for other types and maybe for json.

There's been previous discussion about something similar, which would be 
better supporting "casting an unknown to smallint". IIRC there's some 
non-trivial problem with trying to support that.

> 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.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (31+ messages)  latest in thread

Message-ID: <6e36f08b-0fa5-445e-55bc-654b9afb7f04@BlueTreble.com>
Permalink:  ../6e36f08b-0fa5-445e-55bc-654b9afb7f04@BlueTreble.com/
Also on:    postgresql.org/message-id/6e36f08b-0fa5-445e-55bc-654b9afb7f04@BlueTreble.com

 · 

reply

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: Jim.Nasby@BlueTreble.com, n.gluhov@postgrespro.ru, a.lubennikova@postgrespro.ru
  Subject: Re: Cast jsonb to numeric, int, float, bool
  In-Reply-To: <6e36f08b-0fa5-445e-55bc-654b9afb7f04@BlueTreble.com>

* 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