Ci sono molti modi per farlo, ma se hai voglia di giocare con le funzioni della finestra puoi RANK()
o DENSE_RANK()
i pesi per id ed elimina i primi ranghi in una query esterna:
WITH cte AS (
SELECT id, ('{user,'||index-1||'}')::text[] as json_path, (value->'user_weight')::text::numeric AS weight
FROM user_table, jsonb_array_elements(json_field->'user')
WITH ordinality arr(value, index)
WHERE arr.value->>'user_name' IN ('Devang', 'Meet')
ORDER BY id, value->'user_weight' DESC
)
SELECT * FROM (
SELECT cte.*,
RANK() OVER (PARTITION BY id ORDER BY id,weight DESC
RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS r
FROM cte) j
WHERE r > 1;
Demo:db<>fiddle