Skip to content

Commit

Permalink
Disable FDW support on Postgres 11+ (see bluejekyll#49); created new …
Browse files Browse the repository at this point in the history
…feature flag

Unfortunately, FDW examples and tests have to be disabled entirely,
because 'examples/fdw' cannot depend on 'pg-extend' crate features.
  • Loading branch information
intgr committed Oct 9, 2019
1 parent f798bba commit 85ea16d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
16 changes: 0 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ debug = true
members = [
"pg-extend",
"pg-extern-attr",
"examples/adding",
"examples/fdw",
"examples/fdw-rw",
"examples/adding",
# FDW examples disabled because it's broken with PostgreSQL 11, 12. See https://github.com/bluejekyll/pg-extend-rs/issues/49
# "examples/fdw",
# "examples/fdw-rw",
"examples/logging",
"examples/memory_context",
"examples/nullable",
Expand Down
3 changes: 3 additions & 0 deletions integration-tests/tests/fdw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.

// FDW tests disabled because it's broken with PostgreSQL 11, 12. See issue #49
#![cfg(fdw_is_broken)]

extern crate integration_tests;

use integration_tests::*;
Expand Down
7 changes: 4 additions & 3 deletions pg-extend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ license = "MIT/Apache-2.0"
build = "build.rs"

[features]
default = ["postgres-10"]
postgres-9 = []
postgres-10 = []
default = ["postgres-11", "fdw"]
fdw = []
postgres-9 = ["fdw"]
postgres-10 = ["fdw"]
postgres-11 = []

[dependencies]
Expand Down
7 changes: 7 additions & 0 deletions pg-extend/src/pg_fdw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
//! and https://bitbucket.org/adunstan/rotfang-fdw/src/ca21c2a2e5fa6e1424b61bf0170adb3ab4ae68e7/src/rotfang_fdw.c?at=master&fileviewer=file-view-default
//! For use with `#[pg_foreignwrapper]` from pg-extend-attr
// FDW on PostgreSQL 12 is not supported yet :(
#![cfg(feature = "fdw")]

// If anyone tries to enable "fdw" feature with newer Postgres, throw error.
#[cfg(any(feature = "postgres-11", feature = "postgres-12"))]
compile_error!("pg-extend-rs does not support FDW on PostgreSQL 11 or newer. See https://github.com/bluejekyll/pg-extend-rs/issues/49");

use std::boxed::Box;
use std::collections::HashMap;
use std::ffi::{CStr, CString};
Expand Down

0 comments on commit 85ea16d

Please sign in to comment.