Transform a temporal JSONB to another subtype
tjsonbInst(tjsonb) → tjsonbInst tjsonbSeq(tjsonb,interp text='step') → tjsonbSeq tjsonbSeqSet(tjsonb) → tjsonbSeqSet
SELECT tjsonbSeq(tjsonb '"{\"vehicleId\": 1, \"location\": \"Point(1 1)\"}"@2001-01-01');
-- ["{\"location\": \"Point(1 1)\", \"vehicleId\": 1}"@2001-01-01]
SELECT tjsonbSeq(tjsonb '"{\"vehicleId\": 1, \"location\": \"Point(1 1)\"}"@2001-01-01',
'discrete');
-- {"{\"location\": \"Point(1 1)\", \"vehicleId\": 1}"@2001-01-01}
SELECT tjsonbSeqSet(tjsonb '"{\"vehicleId\": 1,\"location\":\"Point(1 1)\"}"@2001-01-01');
-- {["{\"location\": \"Point(1 1)\", \"vehicleId\": 1}"@2001-01-01]}
Transform a temporal JSONB value to another interpolation
setInterp(tjsonb,interp) → tjsonb
SELECT setInterp(tjsonb '"{\"vehicleId\": 1,\"location\": \"Point(1 1)\"}"@2001-01-01',
'step');
-- ["{\"location\": \"Point(1 1)\", \"vehicleId\": 1}"@2001-01-01]
SELECT setInterp(tjsonb '{[{"vehicleId": 1, "location": "Point(1 1)"}@2001-01-01],
[{"vehicleId": 1, "location": "Point(1 1)"}@2001-01-02]}', 'discrete');
/* {"{\"location\": \"Point(1 1)\", \"vehicleId\": 1}"@2001-01-01, "{\"location\":
\"Point(1 1)\", \"vehicleId\": 1}"@2001-01-02} */