ibarwick / firebird_fdw

A PostgreSQL foreign data wrapper (FDW) for Firebird - latest version 1.4.0 (2024-05-11)
https://sql-info.de/postgresql/firebird-fdw/index.html
Other
36 stars 9 forks source link

Automatically reconnect on dropped connections. #3

Closed puddingpimp closed 6 years ago

puddingpimp commented 8 years ago

Store the connection parameters in ConnCacheEntry so we can reconnect when the connection fails, and reconnect automatically.

ibarwick commented 6 years ago

Time passes... and finally had some round-tuits to implement this, albeit in a slightly different way.

9.5 support has been long since added, the code is compatible up until PostgreSQL 10, and will compile under current PostgreSQL HEAD.

Thanks for the submission, hopefully it won't take this long to deal with any further ones

ibarwick commented 6 years ago

For the record it now behaves like this:

postgres=# SELECT * from fb_instest;
 id | val
----+-----
  1 | foo
(1 row)

Time: 300.399 ms
postgres=# SELECT * from fb_instest;
WARNING:  Firebird server connection has gone away
ERROR:  Unable to to connect to foreign server
DETAIL:  Unable to complete network request to host "localhost".
 - Failed to establish a connection.

Time: 6.648 ms
postgres=# SELECT * from fb_instest;
WARNING:  Firebird server connection has gone away
NOTICE:  reconnected to Firebird server
 id | val
----+-----
  1 | foo
(1 row)

Time: 72.800 ms