From 2f90bf268645bf62feb42583a6111da856424f91 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Fri, 9 Nov 2018 12:07:27 +0900 Subject: [PATCH] 1.0.0 release --- CHANGELOG | 8 ++- META.json | 2 +- Makefile | 4 +- firebird_fdw.control | 2 +- .../redhat/postgresql10-firebird_fdw.spec | 6 +- .../redhat/postgresql11-firebird_fdw.spec | 62 +++++++++++++++++++ .../redhat/postgresql93-firebird_fdw.spec | 6 +- .../redhat/postgresql94-firebird_fdw.spec | 6 +- .../redhat/postgresql95-firebird_fdw.spec | 6 +- .../redhat/postgresql96-firebird_fdw.spec | 6 +- sql/firebird_fdw--0.5.0--1.0.0.sql | 2 + sql/firebird_fdw--1.0.0.sql | 36 +++++++++++ src/firebird_fdw.h | 2 +- t/01-extension.pl | 2 +- 14 files changed, 137 insertions(+), 13 deletions(-) create mode 100644 packaging/redhat/postgresql11-firebird_fdw.spec create mode 100644 sql/firebird_fdw--0.5.0--1.0.0.sql create mode 100644 sql/firebird_fdw--1.0.0.sql diff --git a/CHANGELOG b/CHANGELOG index b3cffcd..7dbcb75 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,12 +1,14 @@ Revision history for firebird_fdw -0.6.0 2018-10-?? +1.0.0 2018-11-09 - Support Firebird BOOLEAN datatype (Firebird 3.0 and later) - Improve "IMPORT FOREIGN SCHEMA" implementation - - Avoid segfault if not all expected Firebird connection parameters - were supplied - Add table option "estimated_row_count" + - Improve handling of foreign tables defined as Firebird queries + - Support PostgreSQL 11 - Adapt code to compile against current PostgreSQL HEAD + - Avoid segfault if not all expected Firebird connection parameters + were supplied 0.5.0 2018-10-12 - Support triggers on foreign tables (PostgreSQL 9.4 and later) diff --git a/META.json b/META.json index 1073281..78bd42a 100644 --- a/META.json +++ b/META.json @@ -1,7 +1,7 @@ { "name": "firebird_fdw", "abstract": "A PostgreSQL foreign data wrapper (FDW) for Firebird", - "version": "0.5.0", + "version": "1.0.0", "release_status": "stable", "maintainer": "Ian Barwick ", "license": { diff --git a/Makefile b/Makefile index ffd7dde..3984309 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,9 @@ DATA = sql/firebird_fdw--0.3.0.sql \ sql/firebird_fdw--0.3.0--0.4.0.sql \ sql/firebird_fdw--0.4.0.sql \ sql/firebird_fdw--0.4.0--0.5.0.sql \ - sql/firebird_fdw--0.5.0.sql + sql/firebird_fdw--0.5.0.sql \ + sql/firebird_fdw--0.5.0--1.0.0.sql \ + sql/firebird_fdw--1.0.0.sql PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) diff --git a/firebird_fdw.control b/firebird_fdw.control index dc5a468..a6143ce 100644 --- a/firebird_fdw.control +++ b/firebird_fdw.control @@ -1,5 +1,5 @@ # Firebird FDW comment = 'foreign data wrapper for Firebird' -default_version = '0.5.0' +default_version = '1.0.0' module_pathname = '$libdir/firebird_fdw' relocatable = true diff --git a/packaging/redhat/postgresql10-firebird_fdw.spec b/packaging/redhat/postgresql10-firebird_fdw.spec index 7081db8..815fe6d 100644 --- a/packaging/redhat/postgresql10-firebird_fdw.spec +++ b/packaging/redhat/postgresql10-firebird_fdw.spec @@ -1,6 +1,6 @@ Summary: A PostgreSQL foreign data wrapper (FDW) for Firebird Name: postgresql10-firebird_fdw -Version: 0.5.0 +Version: 1.0.0 Release: 1 Source: firebird_fdw-%{version}.tar.gz URL: https://github.com/ibarwick/firebird_fdw @@ -45,9 +45,13 @@ rm -rf $RPM_BUILD_ROOT %{pgsql_path}/share/extension/firebird_fdw--0.4.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.4.0--0.5.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.5.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.5.0--1.0.0.sql +%{pgsql_path}/share/extension/firebird_fdw--1.0.0.sql %{pgsql_path}/share/extension/firebird_fdw.control %changelog +* Fri Nov 9 2018 Ian Barwick (barwick@gmail.com) +- 1.0.0 release * Fri Oct 12 2018 Ian Barwick (barwick@gmail.com) - 0.5.0 release * Tue Oct 2 2018 Ian Barwick (barwick@gmail.com) diff --git a/packaging/redhat/postgresql11-firebird_fdw.spec b/packaging/redhat/postgresql11-firebird_fdw.spec new file mode 100644 index 0000000..55a1428 --- /dev/null +++ b/packaging/redhat/postgresql11-firebird_fdw.spec @@ -0,0 +1,62 @@ +Summary: A PostgreSQL foreign data wrapper (FDW) for Firebird +Name: postgresql11-firebird_fdw +Version: 1.0.0 +Release: 1 +Source: firebird_fdw-%{version}.tar.gz +URL: https://github.com/ibarwick/firebird_fdw +License: PostgreSQL +Group: Productivity/Databases/Tools +Packager: Ian Barwick +BuildRequires: postgresql11-devel firebird-devel +BuildRequires: libfq +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Requires: postgresql11-server libfq + +%define pgsql_path /usr/pgsql-11 + +%description +This is a foreign data wrapper (FDW) to connect PostgreSQL to Firebird. +It provides both read (SELECT) and write (INSERT/UPDATE/DELETE) +support, WHERE-clause pushdowns, connection caching and Firebird transaction +support. + +This code is very much work-in-progress; USE AT YOUR OWN RISK. + +%prep +%setup + +%build +export PG_CONFIG=%{pgsql_path}/bin/pg_config +PG_CPPFLAGS="-I/usr/include/firebird" USE_PGXS=1 make + +%install +rm -rf $RPM_BUILD_ROOT +export PG_CONFIG=%{pgsql_path}/bin/pg_config +USE_PGXS=1 make DESTDIR=$RPM_BUILD_ROOT install + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-, root, root) +%{pgsql_path}/lib/firebird_fdw.so +%{pgsql_path}/share/extension/firebird_fdw--0.3.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.3.0--0.4.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.4.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.4.0--0.5.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.5.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.5.0--1.0.0.sql +%{pgsql_path}/share/extension/firebird_fdw--1.0.0.sql +%{pgsql_path}/share/extension/firebird_fdw.control + +%changelog +* Fri Nov 9 2018 Ian Barwick (barwick@gmail.com) +- 1.0.0 release +* Fri Oct 12 2018 Ian Barwick (barwick@gmail.com) +- 0.5.0 release +* Tue Oct 2 2018 Ian Barwick (barwick@gmail.com) +- 0.4.0 release +* Sun Apr 22 2018 Ian Barwick (barwick@gmail.com) +- 0.3.0 release +* Sun Feb 2 2014 Ian Barwick (barwick@gmail.com) +- First draft diff --git a/packaging/redhat/postgresql93-firebird_fdw.spec b/packaging/redhat/postgresql93-firebird_fdw.spec index a5f477b..61f772a 100644 --- a/packaging/redhat/postgresql93-firebird_fdw.spec +++ b/packaging/redhat/postgresql93-firebird_fdw.spec @@ -1,6 +1,6 @@ Summary: A PostgreSQL foreign data wrapper (FDW) for Firebird Name: postgresql93-firebird_fdw -Version: 0.5.0 +Version: 1.0.0 Release: 1 Source: firebird_fdw-%{version}.tar.gz URL: https://github.com/ibarwick/firebird_fdw @@ -45,9 +45,13 @@ rm -rf $RPM_BUILD_ROOT %{pgsql_path}/share/extension/firebird_fdw--0.4.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.4.0--0.5.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.5.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.5.0--1.0.0.sql +%{pgsql_path}/share/extension/firebird_fdw--1.0.0.sql %{pgsql_path}/share/extension/firebird_fdw.control %changelog +* Fri Nov 9 2018 Ian Barwick (barwick@gmail.com) +- 1.0.0 release * Fri Oct 12 2018 Ian Barwick (barwick@gmail.com) - 0.5.0 release * Tue Oct 2 2018 Ian Barwick (barwick@gmail.com) diff --git a/packaging/redhat/postgresql94-firebird_fdw.spec b/packaging/redhat/postgresql94-firebird_fdw.spec index 937fa6f..b98c760 100644 --- a/packaging/redhat/postgresql94-firebird_fdw.spec +++ b/packaging/redhat/postgresql94-firebird_fdw.spec @@ -1,6 +1,6 @@ Summary: A PostgreSQL foreign data wrapper (FDW) for Firebird Name: postgresql94-firebird_fdw -Version: 0.5.0 +Version: 1.0.0 Release: 1 Source: firebird_fdw-%{version}.tar.gz URL: https://github.com/ibarwick/firebird_fdw @@ -45,9 +45,13 @@ rm -rf $RPM_BUILD_ROOT %{pgsql_path}/share/extension/firebird_fdw--0.4.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.4.0--0.5.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.5.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.5.0--1.0.0.sql +%{pgsql_path}/share/extension/firebird_fdw--1.0.0.sql %{pgsql_path}/share/extension/firebird_fdw.control %changelog +* Fri Nov 9 2018 Ian Barwick (barwick@gmail.com) +- 1.0.0 release * Fri Oct 12 2018 Ian Barwick (barwick@gmail.com) - 0.5.0 release * Tue Oct 2 2018 Ian Barwick (barwick@gmail.com) diff --git a/packaging/redhat/postgresql95-firebird_fdw.spec b/packaging/redhat/postgresql95-firebird_fdw.spec index b7099ad..aa8398d 100644 --- a/packaging/redhat/postgresql95-firebird_fdw.spec +++ b/packaging/redhat/postgresql95-firebird_fdw.spec @@ -1,6 +1,6 @@ Summary: A PostgreSQL foreign data wrapper (FDW) for Firebird Name: postgresql95-firebird_fdw -Version: 0.5.0 +Version: 1.0.0 Release: 1 Source: firebird_fdw-%{version}.tar.gz URL: https://github.com/ibarwick/firebird_fdw @@ -45,9 +45,13 @@ rm -rf $RPM_BUILD_ROOT %{pgsql_path}/share/extension/firebird_fdw--0.4.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.4.0--0.5.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.5.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.5.0--1.0.0.sql +%{pgsql_path}/share/extension/firebird_fdw--1.0.0.sql %{pgsql_path}/share/extension/firebird_fdw.control %changelog +* Fri Nov 9 2018 Ian Barwick (barwick@gmail.com) +- 1.0.0 release * Fri Oct 12 2018 Ian Barwick (barwick@gmail.com) - 0.5.0 release * Tue Oct 2 2018 Ian Barwick (barwick@gmail.com) diff --git a/packaging/redhat/postgresql96-firebird_fdw.spec b/packaging/redhat/postgresql96-firebird_fdw.spec index 2cf854b..55f84ba 100644 --- a/packaging/redhat/postgresql96-firebird_fdw.spec +++ b/packaging/redhat/postgresql96-firebird_fdw.spec @@ -1,6 +1,6 @@ Summary: A PostgreSQL foreign data wrapper (FDW) for Firebird Name: postgresql96-firebird_fdw -Version: 0.5.0 +Version: 1.0.0 Release: 1 Source: firebird_fdw-%{version}.tar.gz URL: https://github.com/ibarwick/firebird_fdw @@ -45,9 +45,13 @@ rm -rf $RPM_BUILD_ROOT %{pgsql_path}/share/extension/firebird_fdw--0.4.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.4.0--0.5.0.sql %{pgsql_path}/share/extension/firebird_fdw--0.5.0.sql +%{pgsql_path}/share/extension/firebird_fdw--0.5.0--1.0.0.sql +%{pgsql_path}/share/extension/firebird_fdw--1.0.0.sql %{pgsql_path}/share/extension/firebird_fdw.control %changelog +* Fri Nov 9 2018 Ian Barwick (barwick@gmail.com) +- 1.0.0 release * Fri Oct 12 2018 Ian Barwick (barwick@gmail.com) - 0.5.0 release * Tue Oct 2 2018 Ian Barwick (barwick@gmail.com) diff --git a/sql/firebird_fdw--0.5.0--1.0.0.sql b/sql/firebird_fdw--0.5.0--1.0.0.sql new file mode 100644 index 0000000..a812066 --- /dev/null +++ b/sql/firebird_fdw--0.5.0--1.0.0.sql @@ -0,0 +1,2 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION firebird_fdw" to load this file. \quit diff --git a/sql/firebird_fdw--1.0.0.sql b/sql/firebird_fdw--1.0.0.sql new file mode 100644 index 0000000..3c6631a --- /dev/null +++ b/sql/firebird_fdw--1.0.0.sql @@ -0,0 +1,36 @@ +/*------------------------------------------------------------------------- + * + * foreign-data wrapper for Firebird + * + * Copyright (c) 2013-2018 Ian Barwick + * + * This software is released under the PostgreSQL Licence + * + * Author: Ian Barwick + * + * IDENTIFICATION + * firebird_fdw/sql/firebird_fdw--1.0.0.sql + * + *------------------------------------------------------------------------- + */ + +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION firebird_fdw" to load this file. \quit + +CREATE FUNCTION firebird_fdw_handler() +RETURNS fdw_handler +AS 'MODULE_PATHNAME' +LANGUAGE C STRICT; + +CREATE FUNCTION firebird_fdw_validator(text[], oid) +RETURNS void +AS 'MODULE_PATHNAME' +LANGUAGE C STRICT; + +CREATE FOREIGN DATA WRAPPER firebird_fdw + HANDLER firebird_fdw_handler + VALIDATOR firebird_fdw_validator; + +CREATE OR REPLACE FUNCTION firebird_fdw_version() + RETURNS pg_catalog.int4 STRICT + AS 'MODULE_PATHNAME' LANGUAGE C; diff --git a/src/firebird_fdw.h b/src/firebird_fdw.h index 30cff91..d13879c 100644 --- a/src/firebird_fdw.h +++ b/src/firebird_fdw.h @@ -31,7 +31,7 @@ #include "libfq.h" -#define FIREBIRD_FDW_VERSION 500 +#define FIREBIRD_FDW_VERSION 10000 #define FB_FDW_LOGPREFIX "[firebird_fdw] " #define FB_FDW_LOGPREFIX_LEN strlen(FB_FDW_LOGPREFIX) diff --git a/t/01-extension.pl b/t/01-extension.pl index e7b03af..5ef4991 100644 --- a/t/01-extension.pl +++ b/t/01-extension.pl @@ -34,7 +34,7 @@ # # TODO: parse the value from "firebird_fdw.control" and check for a match -my $version = '500'; +my $version = '10000'; my $res = $pg_db->safe_psql(q|SELECT firebird_fdw_version()|);