On 05/04/2017 03:53 PM, tushar wrote:
We can see statement_timeout is working but it is taking some extra time,not sure this is an expected behavior in above case or not.
This is only when remote server is involved . in case when both the servers are on the same machine , then this is working as expected.

d1=# CREATE SERVER myserver_ppas FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'localhost', dbname 'postgres', port '5432', connect_timeout '3');
CREATE SERVER
d1=# CREATE USER MAPPING FOR centos SERVER myserver_ppas OPTIONS (user 'centos', password 'adminedb');
CREATE USER MAPPING
d1=# create foreign table ft_test_ppas (a int ) server myserver_ppas options (table_name 'test1');
CREATE FOREIGN TABLE
d1=#
d1=# insert into ft_test_ppas values (1);
INSERT 0 1
Case 1-
d1=# \timing
Timing is on.
d1=# set statement_timeout =6000;
SET
Time: 0.360 ms
d1=# insert  into ft_test_ppas  values (generate_series(1,10000000));
ERROR:  canceling statement due to statement timeout
Time: 6002.509 ms (00:06.003)
d1=#
Case 2 -
d1=# set statement_timeout =20000;
SET
Time: 0.693 ms
d1=# insert  into ft_test_ppas  values (generate_series(1,10000000));
ERROR:  canceling statement due to statement timeout
Time: 20001.741 ms (00:20.002)
d1=#

--
regards,tushar
EnterpriseDB  https://www.enterprisedb.com/
The Enterprise PostgreSQL Company



--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to