postgresql - How to get size of posgresql jsonb field? -


i have table jsonb field in table.

create table data.items (   id serial not null,   datab jsonb ) 

how size of field in query this:

select id, size(datab) data.items 

for number of bytes used store:

select id, pg_column_size(datab) data.items;

for number of elements on jsonb object:

select id, jsonb_array_length(datab) data.items;


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -