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 4bf5966
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 24 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",
# Examples disabled because FDW support broken with PostgreSQL 11+. See https://github.com/bluejekyll/pg-extend-rs/issues/49
# "examples/fdw",
# "examples/fdw-rw",
"examples/logging",
"examples/memory_context",
"examples/nullable",
Expand Down
2 changes: 1 addition & 1 deletion examples/fdw-rw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ crate-type = ["cdylib"]

[dependencies]
pg-extern-attr = { version = "*", path = "../../pg-extern-attr" }
pg-extend = { version = "*", path = "../../pg-extend" }
pg-extend = { version = "*", path = "../../pg-extend", features = ["fdw"] }
2 changes: 1 addition & 1 deletion examples/fdw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ path = "src/bin.rs"

[dependencies]
pg-extern-attr = { version = "*", path = "../../pg-extern-attr" }
pg-extend = { version = "*", path = "../../pg-extend" }
pg-extend = { version = "*", path = "../../pg-extend", features = ["fdw"] }
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+.
//#![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 = []
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

#![cfg(feature = "fdw")]

// FDW on PostgreSQL 11+ is not supported. :(
// If anyone tries to enable "fdw" feature with newer Postgres, throw error.
#[cfg(feature = "postgres-11")]
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 4bf5966

Please sign in to comment.