I would like to test the behaviour of a program which executes queries to a PostgreSQL server in case of a query timeout.
How could I simulate that?
If you are just trying to simulate a timeout on your application side you could just use a dummy query like:
seconds is some integer value that would simulate a query just not coming back in a reasonable timeframe.
If you want to never come back from a query just run the above and kill the database.
pgrep posgres | xargs kill -15 $1
This would also simulate a query timeout I believe.