Is there a way to remove a value from an array in pgSQL? Or to be more precise, to pop the last value? Judging by this list the answer seems to be no. I can get the result I want with an additional index pointer, but it's a bit cumbersome.
No, I don't think you can. At least not without writing something ugly like:
SELECT ARRAY ( SELECT UNNEST(yourarray) LIMIT ( SELECT array_upper(yourarray, 1) - 1 ) )
1.4m articles
1.4m replys
5 comments
57.0k users