Skip to content

Commit

Permalink
Have cargo-pgrx install command specify version (#187)
Browse files Browse the repository at this point in the history
Right now if you run the command to install cargo-pgrx from the README
or DEVELOPMENT file, it doesn't work because it tries to install the
latest version, while we require an older patch version. This PR changes
these files to have the installation command read the required
cargo-pgrx version from the `Cargo.toml` file.

I didn't write the actual pgrx version (currently 0.12.5) in the file to
avoid adding another thing that needs to be changed every pgrx version
bump.
  • Loading branch information
syvb authored Jan 9, 2025
1 parent 39676ac commit d9d29bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To create a pgvectorscale developer environment, you need the following on your
* [Cargo-pgrx][cargo-pgrx]:
```shell
cargo install --locked cargo-pgrx
cargo install --locked cargo-pgrx --version $(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "pgrx") | .version')
```
You must reinstall cargo-pgrx whenever you update Rust, cargo-pgrx must
be built with the same compiler as pgvectorscale.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ You can install pgvectorscale from source and install it in an existing PostgreS
# install prerequisites
## rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
## pgrx
cargo install --locked cargo-pgrx
## cargo-pgrx with the same version as pgrx
cargo install --locked cargo-pgrx --version $(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "pgrx") | .version')
cargo pgrx init --pg17 pg_config
#download, build and install pgvectorscale
Expand Down

0 comments on commit d9d29bb

Please sign in to comment.