Re: Cast jsonb to numeric, int, float, bool

Teodor Sigaev <teodor@sigaev.ru>

From: Teodor Sigaev <teodor@sigaev.ru>
To: Aleksander Alekseev <a.alekseev@postgrespro.ru>, David Steele <david@pgmasters.net>
Cc: Nikita Glukhov <n.gluhov@postgrespro.ru>, Darafei Praliaskouski <me@komzpa.net>, Anastasia Lubennikova <a.lubennikova@postgrespro.ru>, pgsql-hackers@lists.postgresql.org
Date: 2018-03-27T15:09:17Z
Lists: pgsql-hackers
Hi!

I took a look on patch and it seems to me it looks both incomplete and 
oveflowing. It suggests cast from numeric and bool, but for numeric it suggests 
only numeric, int4 and  int8. This choice looks irrational.

I think, it should support from/to numeric/bool/text only. If we want to have 
casts to from numeric to other numeric types then it should be full set (int2, 
int4, int8, float4, float8).



Aleksander Alekseev wrote:
> Hello everyone,
> 
>> Since this patch was updated after being set a Ready for Committer and
>> there appear to be some open questions, I have set it to Needs Review.
> 
> I decided to take a look.
> 
> The patch didn't apply after changes made in fd1a421f, but I fixed that.
> Also there were no tests. I fixed that too.
> 
> I believe it's "Ready for Committer".
> 

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/


Commits

  1. Add casts from jsonb