psql set default statement_timeout as a user in postgres

You could use your .psqlrc file (if you don’t have one in your home directory, create it; if you’re on Windows instead of *nix, the file is %APPDATA%\postgresql\psqlrc.conf instead) and set the following command:

set statement_timeout to 60000; commit;

That setting is in milliseconds, so that’ll set the timeout to 1 minute. .psqlrc isn’t used with -c nor -X invocations of psql, so that should allow you to get your interactive-mode timeout to 1 minute.

You can then execute the following in psql to verify that the configuration has taken effect:

show statement_timeout;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)