Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable FDW support on Postgres 11+ (see #49); created new feature flag #89

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ 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"] }
4 changes: 4 additions & 0 deletions integration-tests/tests/fdw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
// 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+.
// See See https://github.com/bluejekyll/pg-extend-rs/issues/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 = []
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