Search Postgresql Archives

Re: Having difficulties partitionning with jsonb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 22, 2019 at 5:41 PM ouellet marc-andre <Ouellet_MarcAndre@xxxxxxxxxxx> wrote:
CREATE TABLE test ( id integer, data jsonb ) Partition by range (( data #>> '{info,time}' ));

CREATE TABLE test_part1 PARTITION OF test 
    FOR VALUES FROM ('30000') TO ('40000');

INSERT INTO test VALUES (1,'{"info":[{"time":39814.0,"value":2}, {"time":39815.0,"value":3}]}');


The partitioning _expression_ yields NULL on the given input.

select '{"info":[{"time":39814.0,"value":2}, {"time":39815.0,"value":3}]}'::jsonb #>> '{info,time}';
 ?column?
----------
 (null)
(1 row)

Maybe you meant '{info,0,time}', or maybe you meant '{info,1,time}'.  Or maybe you meant something else. You will have to explain yourself.

Cheers,

Jeff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux