Skip to content

Commit e9d9805

Browse files
authored
pg18 support in extension (#261)
1 parent 1f48de6 commit e9d9805

11 files changed

Lines changed: 104 additions & 131 deletions

File tree

.github/workflows/extension_upgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
git checkout tags/v0.20.0
6161
# pgrx=0.12.5 required for v0.20.0
6262
cargo install cargo-pgrx --version 0.12.5 --locked
63-
cargo pgrx install --pg-config $(cargo pgrx info pg-config pg17)
63+
cargo pgrx install --pg-config $(cargo pgrx info pg-config pg18)
6464
# use integration tests for v0.20.0
6565
make test-integration
6666
- name: Test branch's version

INSTALLATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
1111
2. Install [pgrx](https://github.com/pgcentralfoundation/pgrx)
1212

1313
```bash
14-
cargo install cargo-pgrx --version 0.13.1 --locked
14+
cargo install cargo-pgrx --version 0.16.1 --locked
1515

16-
cargo pgrx init --pg17 $(which pg_config)
16+
cargo pgrx init --pg18 $(which pg_config)
1717
```
1818

1919
3. Clone the repo and install dependencies

extension/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vectorize"
3-
version = "0.22.2"
3+
version = "0.23.0"
44
edition = "2021"
55
publish = false
66

@@ -12,11 +12,12 @@ name = "pgrx_embed_vectorize"
1212
path = "./src/bin/pgrx_embed.rs"
1313

1414
[features]
15-
default = ["pg17"]
15+
default = ["pg18"]
1616
pg14 = ["pgrx/pg14", "pgrx-tests/pg14"]
1717
pg15 = ["pgrx/pg15", "pgrx-tests/pg15"]
1818
pg16 = ["pgrx/pg16", "pgrx-tests/pg16"]
1919
pg17 = ["pgrx/pg17", "pgrx-tests/pg17"]
20+
pg18 = ["pgrx/pg18", "pgrx-tests/pg18"]
2021
pg_test = []
2122

2223
[dependencies]
@@ -28,7 +29,7 @@ chrono = {version = "0.4.26", features = ["serde"] }
2829
handlebars = "5.1.0"
2930
log = "0.4.21"
3031
pgmq = "0.30.1"
31-
pgrx = "=0.13.1"
32+
pgrx = "=0.16.1"
3233
reqwest = {version = "0.12.16", features = ["json"] }
3334
serde = { version = "1.0.173", features = ["derive"] }
3435
serde_json = "1.0.103"
@@ -44,7 +45,7 @@ tokio = {version = "1.29.1", features = ["rt-multi-thread"] }
4445
url = "2.4.0"
4546

4647
[dev-dependencies]
47-
pgrx-tests = "=0.13.1"
48+
pgrx-tests = "=0.16.1"
4849
rand = "0.8.5"
4950
whoami = "1.4.1"
5051

extension/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SQLX_OFFLINE:=true
22
DISTNAME = $(shell grep -m 1 '^name' Cargo.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/')
33
DISTVERSION = $(shell grep -m 1 '^version' Cargo.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/')
4-
PG_VERSION:=17
4+
PG_VERSION:=18
55
DATABASE_URL:=postgres://${USER}:${USER}@localhost:288${PG_VERSION}/postgres
66
PGRX_PG_CONFIG:=$(shell cargo pgrx info pg-config pg${PG_VERSION})
77
PGRX_VERSION := $(shell grep -E "^pgrx\s*=" Cargo.toml | cut -d'"' -f2 | tr -d '=')

extension/sql/vectorize--0.22.2--0.23.0.sql

Whitespace-only changes.

extension/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn rag(
207207
#[pg_extern]
208208
fn generate(
209209
input: &str,
210-
model: default!(String, "'tembo/meta-llama/Meta-Llama-3-8B-Instruct'"),
210+
model: default!(String, "'openai/gpt-4o-mini'"),
211211
api_key: default!(Option<String>, "NULL"),
212212
) -> Result<String> {
213213
let model = Model::new(&model)?;

extension/src/executor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ pub fn batch_texts(
3939
}
4040

4141
// called by pg_cron on schedule
42-
// identifiers new inputs and enqueues them
42+
// identifies new inputs and enqueues them
4343
#[pg_extern]
44-
#[pg_guard]
4544
fn job_execute(job_name: String) {
4645
log!("pg-vectorize: refresh job: {}", job_name);
4746
let runtime = tokio::runtime::Builder::new_current_thread()

0 commit comments

Comments
 (0)