Skip to content

Commit

Permalink
fix: support pg12 and pg11 (#33)
Browse files Browse the repository at this point in the history
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
  • Loading branch information
yihong0618 authored Jun 29, 2023
1 parent d310d84 commit 7fe4b0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
build:
strategy:
matrix:
version: [13]
version: [12, 13]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -44,10 +44,11 @@ jobs:
cargo install cargo-pgrx --version "0.8.0"
cargo pgrx init --pg${{ matrix.version }}=download
- name: Build
run: cargo build --verbose
run: cargo build --no-default-features --features "pg${{ matrix.version }}" --verbose
- name: Semantic check
run: cargo clippy
run: cargo clippy --no-default-features --features "pg${{ matrix.version }}"
- name: Test
env:
RUST_BACKTRACE: 1
run: cargo test --all --no-default-features --features "pg${{ matrix.version }} pg_test" -- --nocapture

7 changes: 5 additions & 2 deletions src/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ fn am_handler(_fc_info: pg_sys::FunctionCallInfo) -> PgBox<pg_sys::IndexAmRoutin

am_routine.amstrategies = 3;
am_routine.amsupport = 1;
am_routine.amoptsprocnum = 0;

am_routine.amcanorder = false;
am_routine.amcanorderbyop = true;
Expand All @@ -34,7 +33,11 @@ fn am_handler(_fc_info: pg_sys::FunctionCallInfo) -> PgBox<pg_sys::IndexAmRoutin
am_routine.amclusterable = false;
am_routine.ampredlocks = true;
am_routine.amcaninclude = false;
am_routine.amusemaintenanceworkmem = false;
#[cfg(any(feature = "pg13", feature = "pg14", feature = "pg15"))]
{
am_routine.amoptsprocnum = 0;
am_routine.amusemaintenanceworkmem = false;
}
am_routine.amkeytype = pgrx::pg_sys::InvalidOid;

am_routine.amvalidate = Some(am_validate);
Expand Down

0 comments on commit 7fe4b0c

Please sign in to comment.