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

Using as proxy #11

Closed a0s closed 4 years ago

a0s commented 4 years ago

Hi! I have Firebird-based system with Firebird DB. And I have data consumer that know (and able connect) about PostgreSQL only. Can this extension (firebird_fdw) helps me connect my postgres-only client to Firebird? Will it be realtime data access or have some delay?

ibarwick commented 4 years ago

Can this extension (firebird_fdw) helps me connect my postgres-only client to Firebird?

I imagine this would work; you'd need to create all the Firebird tables/views the client needs to access as foreign tables in PostgreSQL, paying attention to things like potential data type compatibility issues. firebird_fdw supports IMPORT FOREIGN SCHEMA, which can help with that.

Will it be realtime data access or have some delay?

It will inevitably be somewhat slower than querying Firebird directly, as PostgreSQL needs to parse the query, forwards it to Firebird, retrieve the data set from Firebird and return it to the PostgreSQL client. How much the delay is will depend on your server environment, workload, data set etc.

a0s commented 4 years ago

Ok, it seems working! Thank you very much!

BTW, how to build firebird_fdw and postgres11 (from docker hub) together:

FROM postgres:11
RUN \
  apt update && \
  apt install -y --no-install-recommends \
    autoconf \
    build-essential \
    git \
    ca-certificates \
    firebird-dev \
    libpq-dev \
    postgresql-server-dev-11 && \
  git clone "https://github.com/ibarwick/libfq.git" /usr/src/libfq && \
  cd /usr/src/libfq && autoconf && ./configure && make && make install && \
  git clone "https://github.com/ibarwick/firebird_fdw.git" /usr/src/firebird_fdw && \
  cd /usr/src/firebird_fdw && make && make install
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/local/lib