sql-info.de

Firebird Foreign Data Wrapper (FDW)

A PostgreSQL foreign data wrapper (FDW) for the Firebird database.


After a long hiatus, I've finally found time to update firebird_fdw, which is now available as version 0.3.0.

This update, together with an update of the underlying Firebird API wrapper libfq to version 0.2.0, is a general cleanup/bugfix release, with improvements including:

  • support for PostgreSQL 9.6 and 10
  • support for IMPORT FOREIGN SCHEMA (PostgreSQL 9.5 and later)
  • automatic reconnection to Firebird
  • improved error message handling and display
  • improved memory handling and prevention of various unhandled situations which caused the PostgreSQL server to crash

Additionally, CentOS rpm packages are now available via the Fedora Copr build system.

This release has been developed and tested with Firebird 2.5. It will work with Firebird 3.0, but does not yet take advantage of any new features; future releases will hopefully address this.

Posted at 8:46 PM

Let's assume you have a CSV file which looks like this:

    $ head -5 /tmp/prod.csv
    1,14,ACADEMY ACADEMY,PENELOPE GUINESS,25.99,0,1976
    2,6,ACADEMY ACE,EWAN RICKMAN,20.99,0,6289
    3,6,ACADEMY ADAPTATION,VIVIEN KAHN,28.99,0,7173
    4,3,ACADEMY AFFAIR,ALAN MARX,14.99,0,8042
    5,3,ACADEMY AFRICAN,CARRIE HANNAH,11.99,1,2183
Posted at 3:34 PM

Well I've finally fulfilled one of my 2013 New Year's resolutions, which was to write some kind of foreign data wrapper, so with no further ado here is the initial implementation. It is basically working but is still very much in the proof-of-concept/unstable/may-eat-your-data stage. Having said that, if anyone has a practical use for this I'd be very interested to hear about it - my main motivation for creating this FDW is to learn more about PostgreSQL internals.

Posted at 10:28 AM