What to use instead of WITH ORDINALITY in PostgreSQL 9.3
Instead of

SELECT unnest, ordinality
FROM unnest(ARRAY[6,5,4,3,2,1]) WITH ORDINALITY;


you can also write

SELECT unnest, row_number() OVER () AS ordinality
FROM unnest(ARRAY[6,5,4,3,2,1]);


Something like:

...
from s_product
  join (
    select unnest, row_number() over ()
    from unnest(array[....])
  ) as x(shopid, idx) 
    on s_product.product_shop_id = x.shopid
....