“could not identify an equality operator for type json” when using distinct December 20, 2023 by Tarik Use jsonb_build_object. Notice the b for binary after json.