Skip to content

Commit c0ba33d

Browse files
committed
Change pgx to pgrx
1 parent 7e592ec commit c0ba33d

File tree

6 files changed

+130
-164
lines changed

6 files changed

+130
-164
lines changed

ADVANCED-INSTALL.md

Lines changed: 29 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ One way to install `pgdd` is to install from source by cloning this repository.
1212

1313
### Prereqs
1414

15-
Pgx and its dependencies are the main prereq for PgDD.
15+
pgrx and its dependencies are the main prereq for PgDD.
1616
Install Prereqs and ensure PostgreSQL dev tools are installed.
1717

18-
> See the [Cargo PGX](https://github.com/zombodb/pgx/tree/master/cargo-pgx)
19-
documentation for more information on using pgx.
18+
> See the [Cargo pgrx](https://github.com/zombodb/pgrx/tree/master/cargo-pgrx)
19+
documentation for more information on using pgrx.
2020

2121

2222
```bash
@@ -25,18 +25,18 @@ sudo apt install postgresql-server-dev-all libreadline-dev zlib1g-dev curl \
2525
graphviz
2626
```
2727

28-
[Install Rust](https://www.rust-lang.org/tools/install) and Pgx.
28+
[Install Rust](https://www.rust-lang.org/tools/install) and pgrx.
2929

3030
```bash
3131
curl https://sh.rustup.rs -sSf | sh -s -- -y
3232
source $HOME/.cargo/env
3333
```
3434

35-
Install `cargo-pgx` regularly (see dev steps below for non-standard install).
35+
Install `cargo-pgrx` regularly (see dev steps below for non-standard install).
3636

3737

3838
```bash
39-
cargo install --locked cargo-pgx
39+
cargo install --locked cargo-pgrx
4040
```
4141

4242

@@ -47,13 +47,13 @@ cargo install cargo-deb
4747
```
4848

4949

50-
Initialize pgx. Need to run this after install AND occasionally to get updates
51-
to Postgres versions or glibc updates. Not typically required to follow pgx
50+
Initialize pgrx. Need to run this after install AND occasionally to get updates
51+
to Postgres versions or glibc updates. Not typically required to follow pgrx
5252
developments.
5353

5454

5555
```bash
56-
cargo pgx init
56+
cargo pgrx init
5757
```
5858

5959

@@ -74,7 +74,7 @@ changes the last two digits of the port!
7474

7575

7676
```bash
77-
cargo pgx run pg14
77+
cargo pgrx run pg14
7878
```
7979

8080
The output starts with something similar to:
@@ -87,19 +87,19 @@ building extension with features `pg14`
8787

8888

8989
```bash
90-
Copying control file to `/home/username/.pgx/14.0/pgx-install/share/postgresql/extension/pgdd.control`
91-
Copying shared library to `/home/username/.pgx/14.0/pgx-install/lib/postgresql/pgdd.so`
90+
Copying control file to `/home/username/.pgrx/14.0/pgrx-install/share/postgresql/extension/pgdd.control`
91+
Copying shared library to `/home/username/.pgrx/14.0/pgrx-install/lib/postgresql/pgdd.so`
9292
Building SQL generator with features `pg14`
9393
"cargo" "build" "--bin" "sql-generator" "--features" "pg14" "--no-default-features"
9494
Compiling pgdd v0.4.0 (/home/username/git/pgdd)
9595
Finished dev [unoptimized + debuginfo] target(s) in 13.84s
9696
Discovering SQL entities
9797
Discovered 9 SQL entities: 0 schemas (0 unique), 6 functions, 0 types, 0 enums, 3 sqls, 0 ords, 0 hashes
9898
running SQL generator with features `pg14`
99-
"cargo" "run" "--bin" "sql-generator" "--features" "pg14" "--no-default-features" "--" "--sql" "/home/username/.pgx/14.0/pgx-install/share/postgresql/extension/pgdd--0.4.1-dev.sql"
99+
"cargo" "run" "--bin" "sql-generator" "--features" "pg14" "--no-default-features" "--" "--sql" "/home/username/.pgrx/14.0/pgrx-install/share/postgresql/extension/pgdd--0.4.1-dev.sql"
100100
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
101-
Running `target/debug/sql-generator --sql /home/username/.pgx/14.0/pgx-install/share/postgresql/extension/pgdd--0.4.1-dev.sql`
102-
Copying extension schema file to `/home/username/.pgx/14.0/pgx-install/share/postgresql/extension/pgdd--0.4.1-dev.sql`
101+
Running `target/debug/sql-generator --sql /home/username/.pgrx/14.0/pgrx-install/share/postgresql/extension/pgdd--0.4.1-dev.sql`
102+
Copying extension schema file to `/home/username/.pgrx/14.0/pgrx-install/share/postgresql/extension/pgdd--0.4.1-dev.sql`
103103
Finished installing pgdd
104104
Starting Postgres v14 on port 28814
105105
Re-using existing database pgdd
@@ -111,13 +111,13 @@ In the test instance of psql, create the extension in database.
111111
CREATE EXTENSION pgdd;
112112
```
113113

114-
> Note: When you see "Re-using existing database pgdd" your previous installed version of `pgdd` will be available. To ensure you are working with the latest version of the `pgdd` extension you must drop/create the extension, quit the psql shell, and re-run the `cargo pgx run` command.
114+
> Note: When you see "Re-using existing database pgdd" your previous installed version of `pgdd` will be available. To ensure you are working with the latest version of the `pgdd` extension you must drop/create the extension, quit the psql shell, and re-run the `cargo pgrx run` command.
115115
116116

117117
## Build binary packages
118118

119119
Debian/Ubuntu Bionic binaries are available for 0.4.0
120-
(first [pgx](https://github.com/tcdi/pgx) version)
120+
(first [pgrx](https://github.com/tcdi/pgrx) version)
121121
and later. More distributions will likely have binaries available in the future.
122122

123123

@@ -134,62 +134,28 @@ During development some versions may be copied to the `./standalone/` directory.
134134
cp ./target/artifacts/* ./standalone/
135135
```
136136

137-
## Pgx Generate graphviz
137+
## pgrx Generate graphviz
138138

139139
```bash
140-
cargo pgx schema -d pgdd.dot
140+
cargo pgrx schema -d pgdd.dot
141141
dot -Goverlap=prism -Gspline=ortho -Tjpg pgdd.dot > pgdd.jpg
142142
```
143143

144-
![pgx dependencies for pgdd](pgdd.jpg)
144+
![pgrx dependencies for pgdd](pgdd.jpg)
145145

146146

147147
## Non-standard dev
148148

149-
When working against Pgx installed from a non-tagged branch, install pgx using:
149+
When working against pgrx installed from a non-tagged branch, install pgrx using:
150150

151151
```bash
152-
cargo install --locked --force --git "https://github.com/tcdi/pgx" \
152+
cargo install --locked --force --git "https://github.com/tcdi/pgrx" \
153153
--branch "develop" \
154-
"cargo-pgx"
154+
"cargo-pgrx"
155155
```
156156

157-
Or a beta branch
158157

159-
```bash
160-
cargo install --locked --force cargo-pgx --version 0.2.0-beta.4
161-
```
162-
163-
Changes to `Cargo.toml` required in `[lib]` and `[dependencies]` sections.
164-
165-
166-
```toml
167-
[lib]
168-
# rlib added to build against repo instead of crate (I think)
169-
crate-type = ["cdylib", "rlib"]
170-
#crate-type = ["cdylib"]
171-
```
172-
173-
174-
```toml
175-
[dependencies]
176-
177-
pgx = { git = "https://github.com/tcdi/pgx", branch = "oh-no-type-resolution" }
178-
pgx-macros = { git = "https://github.com/tcdi/pgx", branch = "develop" }
179-
#pgx = "0.1.21"
180-
#pgx-macros = "0.1.21"
181-
182-
# Won't be needed in final version (hopefully!)
183-
pgx-utils = { git = "https://github.com/tcdi/pgx", branch = "develop" }
184-
185-
[dev-dependencies]
186-
pgx-tests = { git = "https://github.com/tcdi/pgx", branch = "develop" }
187-
#pgx-tests = "0.1.21"
188-
```
189-
190-
191-
192-
The following command can be used to force pgx to overwrite the configs it needs to
158+
The following command can be used to force pgrx to overwrite the configs it needs to
193159
for various dev related changes.
194160

195161
Clean things out.
@@ -209,28 +175,28 @@ Force build the schema.
209175

210176

211177
```bash
212-
cargo pgx schema -f
178+
cargo pgrx schema -f
213179
```
214180

215181

216182
## Non-standard In Docker
217183

218-
If testing this extension against non-standard pgx install, update the
184+
If testing this extension against non-standard pgrx install, update the
219185
Dockerfile to install from the specific branch.
220186

221187
Change
222188

223189
```bash
224190
RUN /bin/bash rustup.sh -y \
225-
&& cargo install --locked cargo-pgx
191+
&& cargo install --locked cargo-pgrx
226192
```
227193

228194
To
229195

230196
```bash
231197
RUN /bin/bash rustup.sh -y \
232-
&& cargo install --locked --force --git "https://github.com/tcdi/pgx" \
198+
&& cargo install --locked --force --git "https://github.com/tcdi/pgrx" \
233199
--branch "develop" \
234-
"cargo-pgx"
200+
"cargo-pgrx"
235201
```
236202

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ crate-type = ["cdylib"]
99

1010
[features]
1111
default = ["pg15"]
12-
pg11 = ["pgx/pg11"]
13-
pg12 = ["pgx/pg12"]
14-
pg13 = ["pgx/pg13"]
15-
pg14 = ["pgx/pg14"]
16-
pg15 = ["pgx/pg15"]
12+
pg11 = ["pgrx/pg11"]
13+
pg12 = ["pgrx/pg12"]
14+
pg13 = ["pgrx/pg13"]
15+
pg14 = ["pgrx/pg14"]
16+
pg15 = ["pgrx/pg15"]
1717
pg_test = []
1818

1919
[dependencies]
20-
pgx = "=0.7.1"
21-
pgx-macros = "=0.7.1"
20+
pgrx = "=0.7.4"
21+
pgrx-macros = "=0.7.4"
2222

2323

2424
[dev-dependencies]
25-
pgx-tests = "=0.7.1"
25+
pgrx-tests = "=0.7.4"
2626

2727

2828
[profile.dev]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 - 2022 Ryan Lambert
3+
Copyright (c) 2018 - 2023 Ryan Lambert
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The PostgreSQL Data Dictionary (`pgdd`) is an in-database solution to provide
44
introspection via standard SQL query syntax. This extension makes it easy to
55
provide a usable data dictionary to all users of a PostgreSQL database.
66

7-
The extension is built on the Rust [pgx framework](https://github.com/zombodb/pgx) as of version 0.4.0.
7+
The extension is built on the Rust [pgrx framework](https://github.com/tcdi/pgrx) as of version 0.4.0.
88

99

1010
## Compatibility
@@ -270,18 +270,18 @@ GRANT dd_readwrite TO <your_login_user>;
270270
## Upgrade extension
271271

272272
Version 0.4.0 was a complete rewrite of the PgDD extension from a raw-SQL
273-
extension to using the [pgx framework](https://github.com/zombodb/pgx).
273+
extension to using the [pgrx framework](https://github.com/zombodb/pgrx).
274274

275275

276276
Upgrading versions currently requires `DROP EXTENSION pgdd; CREATE EXTENSION pgdd;`
277277
to recreate the extension.
278-
This is unlikely to change until [pgx #121 is resolved](https://github.com/zombodb/pgx/issues/121).
278+
This is unlikely to change until [pgrx #121 is resolved](https://github.com/zombodb/pgrx/issues/121).
279279

280280

281281

282282
If custom attributes were stored in the `dd` tables you will need to use
283283
`pg_dump` to export the data and reload after recreating the extension
284-
with pgx. If any of the three (3) queries below return a count > 0
284+
with pgrx. If any of the three (3) queries below return a count > 0
285285
this applies to you.
286286

287287

@@ -330,7 +330,7 @@ End user caveats:
330330
Extension developer caveats:
331331

332332
* DDL changes made in `src/lib.rs` need to be in version-to-version upgrade (e.g. ``sql/pgdd-0.3.1--0.4.0.sql``). This trick is not being used due to
333-
[pgx #121](https://github.com/zombodb/pgx/issues/121). The Pgx functionality is exposed
333+
[pgrx #121](https://github.com/zombodb/pgrx/issues/121). The pgrx functionality is exposed
334334
via functions, and the functions are the core problem here.
335335

336336

sql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pgx generated SQL files go in this folder.
1+
pgrx generated SQL files go in this folder.

0 commit comments

Comments
 (0)