I have a table entities with a jsonb column dict which holds the locales as described below:
{
"fr": {
"key1": "french1",
"key2": "french2"
},
"en": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
}
In the same table I have created a new tsvector column en_locale which need to hold the tsvector of the concatenation of the dict -> 'en' values.
for the example above I would like to achieve the following which is the concatenation of the values (order doesn't need to be preserved):
value1 value2 value3 values are separated by spaces.
this is in order to populate the tsvector column to_tsvector('value1 value2 value3')
Any advice would be great! Thank you very much!
to_tsvector(dict -> 'en')would only include the values as well: dbfiddle.uk/… (Btw: I think the duplicatedkey2is a typo, right?)to_tsvector(cfg, jsonb)is not supported :(