diff --git a/README.md b/README.md index a2482ef9d..f9611fb3a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ `pgx` supports Postgres v10, v11, v12, and v13. -Feel free to join our [Discord Server](https://discord.gg/hPb93Y9). +**Feel free to join our [Discord Server](https://discord.gg/hPb93Y9).** ## Key Features @@ -114,13 +114,16 @@ custom types. ## System Requirements - - `cargo install rustfmt` +- `rustc` (minimum version 1.52) 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 +184,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 [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 `cargo-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/) 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 {