Something like this should work
update postsec
inner join
(
select pc_sec, count(*) as pseccount
from shops
join postsec on st_within(shops.SHAPE,postsec.SHAPE)
where shops.shop_cat between 1 and 9
group by pc_sec
) x on x.pc_sec = postsec.id
set count_column = x.pseccount