Re: [HACKERS] statement_timeout is not working as expected withpostgres_fdw - Mailing list pgsql-hackers

From tushar
Subject Re: [HACKERS] statement_timeout is not working as expected withpostgres_fdw
Date
Msg-id 62c8c804-e082-8527-fda9-e850b1587042@enterprisedb.com
Whole thread Raw
In response to Re: [HACKERS] statement_timeout is not working as expected withpostgres_fdw  (tushar <tushar.ahuja@enterprisedb.com>)
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: amul sul
Date:
Subject: Re: [HACKERS] Adding support for Default partition in partitioning
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] statement_timeout is not working as expected with postgres_fdw