Skip to content

Commit a5b9eb5

Browse files
authored
Document need to have a matching version of cargo-pgx in PATH (pgcentralfoundation#964)
And provide an easy way to setup, using the `cargo-local-install` crate
1 parent a3783c3 commit a5b9eb5

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ target/
99
cmake*/
1010
.direnv
1111
pgx-examples/*/target
12+
/bin

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ members = [
3434

3535
[profile.dev.build-override]
3636
opt-level = 3
37+
38+
[workspace.metadata.local-install]
39+
cargo-pgx = { path = "cargo-pgx" }

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,22 @@ Providing wrappers for Postgres' internals is not a straightforward task, and co
278278
to take quite a bit of time. `pgx` is generally ready for use now, and it will continue to be developed as
279279
time goes on. Your feedback about what you'd like to be able to do with `pgx` is greatly appreciated.
280280

281+
## Hacking
282+
283+
If you're hacking on `pgx` and want to ensure your test will run correctly, you need to have the current
284+
implementation of `cargo-pgx` (from the revision you're working on) in your `PATH`.
285+
286+
An easy way would be to install [cargo-local-install](https://github.com/MaulingMonkey/cargo-local-install):
287+
288+
```shell
289+
cargo install cargo-local-install
290+
```
291+
292+
and then run `cargo local-install` to install `cargo-pgx` as specified in top-level's Cargo.toml.
293+
294+
Don't forget to prepend `/path/to/pgx/bin` to your `PATH`!
295+
296+
This approach can also be used in extensions to ensure a matching version of `cargo-pgx` is used.
281297

282298
## License
283299

0 commit comments

Comments
 (0)