Postgres query slow, shows long running active queries, statement_timeout does not work
SET statement_timeout = 1;
SELECT * from "table_name";

  
  does not work. That is... the SELECT statement above takes 400
  milliseconds and doesn't terminate. Seems that I don't have this
  procedure right.


I don't know what else might be going on in your system, but this definitely does work for me as long as "table_name" is large enough to take more than 1 millisecond.  Are you issuing this from 'psql'?  Or if from something else, then what is that?  If you can't trust that your commands are actually getting sent to the database, or that any errors are reliably getting sent back, that is going to make it hard to accomplish anything else.