Sometimes it is required to increase the statement_timeout for Postgres.

The correct way to do this would be to create a .psqlrc in the home directory and add the setting inside there.

$> cat .psqrc
set statement_timeout to 10000;

This is given in milliseconds so the above is for 10 seconds.

This can be verified from within psql command

psql> show statement_timeout;
 statement_timeout
-------------------
 10s
(1 row)

Reference: https://stackoverflow.com/a/24093305/33581