Does postgresql statement_timeout also apply to a blocked query (version 9.6)?
From my tests this does not seem to be the case. I created a blocking query using the following example taken from https://www.citusdata.com/blog/2018/02/15/when-postgresql-blocks/
CREATE TABLE items ( key text primary key, value jsonb ); BEGIN; ALTER TABLE items ADD COLUMN last_update timestamptz;
In a separate SQL session I do the following
set statement_timeout to 10000; commit; select * from items;
Note there is no global timeout set at the database level.
This query does not return with a timeout after 10 seconds. The timeout documentation states "The timeout is measured from the time a command arrives at the server until it is completed by the server." hence I would expect it to apply to blocked queries as well.