Why does constructing this jsonb_array from two jsonb objects fail? Just trying to answer someone's question, and I'm wanting to run this by someone else. Constructing a jsonb array with two key value pairs.

SELECT *
FROM ( VALUES
  (jsonb_build_array(
    '{"k1":"v1","k2":"v2"}'::jsonb,
    '{"k1":"v1","k2"‌​:"v2"}'::jsonb
  ))
) AS t(x);


Getting this error

ERROR:  invalid input syntax for type json
LINE 5:         '{"k1":"v1","k2"‌​:"v2"}'::jsonb
                ^
DETAIL:  Token "‌​" is invalid.
CONTEXT:  JSON data, line 1: {"k1":"v1","k2"‌​...


But this works (dropping the second k/v pair of the second element in the array)

SELECT *
FROM ( VALUES
  (jsonb_build_array(
    '{"k1":"v1","k2":"v2"}'::jsonb,
    '{"k1":"v1"}'::jsonb
  ))
) AS t(x);


Constructing the jsonb array from a jsonb and a text also works..

SELECT *
FROM ( VALUES
  (jsonb_build_array(
    '{"k1":"v1","k2":"v2"}'::jsonb,
    '{"k1":"v1","k2"‌​:"v2"}'
  ))
) AS t(x);


I'm thinking this is a bug.
You have some characters after the "k2" in first query. And because of that it is complainig about invalid syntax.

select *,ascii(c) from unnest(regexp_split_to_array('''{"k1":"v1","k2"​:"v2"}''','')) as c;
 c | ascii
---+-------
 ' |    39
 { |   123
 " |    34
 k |   107
 1 |    49
 " |    34
 : |    58
 " |    34
 v |   118
 1 |    49
 " |    34
 , |    44
 " |    34
 k |   107
 2 |    50
 " |    34
   |  8204
 ​  |  8203
 : |    58
 " |    34
 v |   118
 2 |    50
 " |    34
 } |   125
 ' |    39


If you run your first query like this, it will work:

SELECT *
FROM ( VALUES
  (jsonb_build_array(
    '{"k1":"v1","k2":"v2"}'::jsonb,
    '{"k1":"v1","k2":"v2"}'::jsonb
  ))
) AS t(x);