From 867df254684d701bf4be28623ad63331dc9480c8 Mon Sep 17 00:00:00 2001 From: Tim McNamara Date: Tue, 1 Jun 2021 15:09:14 +1200 Subject: [PATCH 1/4] doc: fix typo --- pgx-macros/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgx-macros/src/lib.rs b/pgx-macros/src/lib.rs index e52721b00..53f7f2d9c 100644 --- a/pgx-macros/src/lib.rs +++ b/pgx-macros/src/lib.rs @@ -16,7 +16,7 @@ use std::collections::HashSet; use syn::spanned::Spanned; use syn::{parse_macro_input, Attribute, Data, DeriveInput, Item, ItemFn}; -/// Declare a function as `#[pg_guard]` to indcate that it is called from a Postgres `extern "C"` +/// Declare a function as `#[pg_guard]` to indicate that it is called from a Postgres `extern "C"` /// function so that Rust `panic!()`s (and Postgres `elog(ERROR)`s) will be properly handled by `pgx` #[proc_macro_attribute] pub fn pg_guard(_attr: TokenStream, item: TokenStream) -> TokenStream { From 731f1beefd8ea7da631871d12eba779db0c5dba4 Mon Sep 17 00:00:00 2001 From: Tim McNamara Date: Tue, 1 Jun 2021 15:37:46 +1200 Subject: [PATCH 2/4] doc: add minimum Rust version, upgrade info Documents the minimum supported stable Rust version (v1.50) and adds instructions for upgrading cargo-pgx. --- README.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a2482ef9d..bfea48636 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ `pgx` supports Postgres v10, v11, v12, and v13. +## Community and Support + Feel free to join our [Discord Server](https://discord.gg/hPb93Y9). ## Key Features @@ -114,13 +116,16 @@ custom types. ## System Requirements - - `cargo install rustfmt` +- `rustc` (minimum version 1.50) and `cargo` +- `cargo install rustfmt` - `git` - `libclang.so` - Ubuntu: `libclang-dev` or `clang` - RHEL: `clang` - [build dependencies for PostgreSQL](https://wiki.postgresql.org/wiki/Compile_and_Install_from_source_code) +Note that a local Postgres installation is not required. `pgx` will download and compile Postgres itself. + ## Getting Started ### 1. Install `cargo-pgx` @@ -181,22 +186,35 @@ The first time, compilation takes a few minutes as `pgx` needs to generate almos Postgres' header files. Once compiled you'll be placed in a `psql` shell, for, in this case, Postgres 13. -Now, we can just [load the extension](https://www.postgresql.org/docs/13/sql-createextension.html) and do a select on the example function. - -```sql -CREATE EXTENSION my_extension; -SELECT hello_my_extension(); -``` +Now, we can just [load the extension](https://www.postgresql.org/docs/13/sql-createextension.html) and do a SELECT on the example function. -This will return something along the lines of +```console +my_extension=# CREATE EXTENSION my_extension; +CREATE EXTENSION -``` +my_extension=# SELECT hello_my_extension(); hello_my_extension --------------------- Hello, my_extension (1 row) ``` + +## Upgrading + +You can upgrade your current `pgx` installation by passing the `--force` flag +to `cargo install`: + +```shell script +$ cargo install --force cargo-pgx +``` + +As new Postgres versions are supported by `pgx`, you can re-run the `pgx init` process to download and compile them: + +```shell script +$ cargo pgx init +``` + ## Digging Deeper - [cargo-pgx sub-command](cargo-pgx/) From c7c1354c29a667885664d2ada15aadc0f4397274 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Wed, 8 Sep 2021 14:02:46 -0700 Subject: [PATCH 3/4] chore: fixups Signed-off-by: Ana Hobden --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bfea48636..18a0828af 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,7 @@ `pgx` supports Postgres v10, v11, v12, and v13. -## Community and Support - -Feel free to join our [Discord Server](https://discord.gg/hPb93Y9). +**Feel free to join our [Discord Server](https://discord.gg/hPb93Y9).** ## Key Features @@ -116,7 +114,7 @@ custom types. ## System Requirements -- `rustc` (minimum version 1.50) and `cargo` +- `rustc` (minimum version 1.52) and `cargo` - `cargo install rustfmt` - `git` - `libclang.so` From 77523bbacb6aa306a261168b58ee715d7e04d29e Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Wed, 8 Sep 2021 14:03:41 -0700 Subject: [PATCH 4/4] chore: how to update cargo-pgx, not pgx Signed-off-by: Ana Hobden --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18a0828af..f9611fb3a 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ The first time, compilation takes a few minutes as `pgx` needs to generate almos Postgres' header files. Once compiled you'll be placed in a `psql` shell, for, in this case, Postgres 13. -Now, we can just [load the extension](https://www.postgresql.org/docs/13/sql-createextension.html) and do a SELECT on the example function. +Now, we can [load the extension](https://www.postgresql.org/docs/13/sql-createextension.html) and do a SELECT on the example function. ```console my_extension=# CREATE EXTENSION my_extension; @@ -200,7 +200,7 @@ my_extension=# SELECT hello_my_extension(); ## Upgrading -You can upgrade your current `pgx` installation by passing the `--force` flag +You can upgrade your current `cargo-pgx` installation by passing the `--force` flag to `cargo install`: ```shell script