category - post relation rebuild
fixed query due to pg not compatible with sql