The OP has the “stuck” queries with the PIDs of each one.
You can use SELECT pg_cancel_backend(__pid__); to ask the query to stop nicely, and SELECT pg_terminate_backend(__pid__); to ask it to stop NOW. (where __pid__ is a number)
For vacuum:
VACUUM VERBOSE ANALYZE posts;
VACUUM VERBOSE ANALYZE topics;
VACUUM VERBOSE ANALYZE post_search_data;