This documentation is sourced from a third-party project and is not maintained by pgEdge.
Development
Set up development environment
- Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Clone the Repository
git clone https://github.com/silver-ymz/pg_tokenizer.rs
cd pg_tokenizer.rs
- Install
cargo-pgrx
cargo install cargo-pgrx --version $(grep -o 'pgrx = "=[^"]*' Cargo.toml | cut -d = -f 3)
cargo pgrx init
Debug
Debug information is enabled in debug and dev-opt profiles. You can build the extension with debug information by specifying the profile. And then you can use gdb to debug the extension.
cargo pgrx build # no compiler optimization
cargo pgrx build --profile dev-opt # with compiler optimization
When setting environment variable RUST_BACKTRACE=1, you can get a backtrace when the program panics.
RUST_BACKTRACE=1 cargo pgrx run --profile dev-opt