4 ms·
> A lack of a colon is clearly an oversight. You mean {"k"}? That's PostgreSQL array syntax, not JSON. It's correct. ('{"k"}' could also be written ARRAY['k'].
by minitech 5y ago
> A lack of a colon is clearly an oversight.
You mean {"k"}? That's PostgreSQL array syntax, not JSON. It's correct. ('{"k"}' could also be written ARRAY['k'].)
- quelltext 5y agoWhat does ARRAY['k'] mean? EDIT: Okay, so I looked up what {'k'} means, i.e. it's an array with one element 'k'. And in the article's function it's the "path" to the key to be set. Still not sure if ARRAY['k'] is a thing, though. I could only find this sort of syntax described in the context of definition, e.g. ARRAY[4] for an array of length 4.
- minitech 5y agoARRAY[elem1, elem2, …] is a PostgreSQL array literal SQL expression.
- hans_castorp 5y ago> Still not sure if ARRAY['k'] is a thing, though. Yes it is. It's an alternative way of writing an array. Typically easier for e.g. text values as the quoting follows the normal SQL rules, e.g. array['foo"bar', 'bla'] vs '{"foo\"bar", "bar"}'