{"id":2348,"date":"2019-02-17T15:10:01","date_gmt":"2019-02-17T20:10:01","guid":{"rendered":"https:\/\/bitpost.com\/news\/?p=2348"},"modified":"2019-02-17T15:27:53","modified_gmt":"2019-02-17T20:27:53","slug":"postgres-jsonb-field-type-conversion","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2019\/postgres-jsonb-field-type-conversion\/","title":{"rendered":"Postgres JSONB field type conversion"},"content":{"rendered":"\n<p>Example to convert a field from real type to integer type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>update bracketevents set json = jsonb_set(json, '{sq_id}', ((round(cast(json->>'sq_id' as real))::text)::jsonb)); <\/code><\/pre>\n\n\n\n<p>All that just remove the $*(@ decimals&#8230; how particular&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Example to convert a field from real type to integer type: All that just remove the $*(@ decimals&#8230; how particular&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[19,10],"tags":[],"class_list":["post-2348","post","type-post","status-publish","format-standard","hentry","category-opensource","category-tricks-tips-tools"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-BS","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=2348"}],"version-history":[{"count":4,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2348\/revisions"}],"predecessor-version":[{"id":2352,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2348\/revisions\/2352"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=2348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=2348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=2348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}