Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cargo-pgrx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,15 +699,15 @@ AS 'MODULE_PATHNAME', 'hello_extension_wrapper';
```

`MODULE_PATHNAME` is replaced by Postgres with the configured value in the `.control` file. For pgrx-based extensions,
this is usually set to `$libdir/<extension-name>`.
this is usually set to `<extension-name>`.

When using versioned shared-object support, the same SQL would look as follows:

```SQL
CREATE OR REPLACE FUNCTION "hello_extension"() RETURNS text /* &str */
STRICT
LANGUAGE c /* Rust */
AS '$libdir/extension-0.0.0', 'hello_extension_wrapper';
AS 'extension-0.0.0', 'hello_extension_wrapper';
```

Note that the versioned shared library is hard-coded in the function definition. This corresponds to the
Expand All @@ -722,7 +722,7 @@ produce the following SQL for the above function:
CREATE OR REPLACE FUNCTION "hello_extension"() RETURNS text /* &str */
STRICT
LANGUAGE c /* Rust */
AS '$libdir/extension-0.1.0', 'hello_extension_wrapper';
AS 'extension-0.1.0', 'hello_extension_wrapper';
```

This SQL must be used in the upgrade script from `0.0.0` to `0.1.0` in order to point the `hello_extension` function to
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/templates/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = '{name}: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/{name}'
module_pathname = '{name}'
relocatable = false
superuser = true
trusted = false
2 changes: 1 addition & 1 deletion pgrx-examples/aggregate/aggregate.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'aggregate: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/aggregate'
module_pathname = 'aggregate'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/arrays/arrays.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'arrays: Created by pgrx'
default_version = '0.1.0'
module_pathname = '$libdir/arrays'
module_pathname = 'arrays'
relocatable = false
superuser = false
schema = arrays
2 changes: 1 addition & 1 deletion pgrx-examples/bad_ideas/bad_ideas.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'bad_ideas: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/bad_ideas'
module_pathname = 'bad_ideas'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/bgworker/bgworker.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'bgworker: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/bgworker'
module_pathname = 'bgworker'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/bytea/bytea.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'bytea: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/bytea'
module_pathname = 'bytea'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/composite_type/composite_type.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'composite_type: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/composite_type'
module_pathname = 'composite_type'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/custom_libname/other_name.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'custom_libname: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/other_name'
module_pathname = 'other_name'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/custom_sql/custom_sql.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'custom_sql: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/custom_sql'
module_pathname = 'custom_sql'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/custom_types/custom_types.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'custom_types: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/custom_types'
module_pathname = 'custom_types'
relocatable = false
superuser = false
trusted = false
2 changes: 1 addition & 1 deletion pgrx-examples/datetime/datetime.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'arrays: Created by pgrx'
default_version = '0.1.0'
module_pathname = '$libdir/datetime'
module_pathname = 'datetime'
relocatable = true
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/errors/errors.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'errors: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/errors'
module_pathname = 'errors'
relocatable = false
superuser = false
schema = errors
2 changes: 1 addition & 1 deletion pgrx-examples/nostd/nostd.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'nostd: Created by pgrx'
default_version = '1.0'
module_pathname = '$libdir/nostd'
module_pathname = 'nostd'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/numeric/numeric.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'numeric: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/numeric'
module_pathname = 'numeric'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/operators/operators.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'operators: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/operators'
module_pathname = 'operators'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/pgtrybuilder/pgtrybuilder.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'pgtrybuilder: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/pgtrybuilder'
module_pathname = 'pgtrybuilder'
relocatable = false
superuser = false
schema = pgtrybuilder
2 changes: 1 addition & 1 deletion pgrx-examples/range/range.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'range: Created by pgrx'
default_version = '0.1.0'
module_pathname = '$libdir/range'
module_pathname = 'range'
relocatable = false
superuser = false
schema = range
2 changes: 1 addition & 1 deletion pgrx-examples/schemas/schemas.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'schemas: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/schemas'
module_pathname = 'schemas'
relocatable = false
superuser = true # b/c this extension creates objects in "pg_catalog"
2 changes: 1 addition & 1 deletion pgrx-examples/shmem/shmem.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'shmem: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/shmem'
module_pathname = 'shmem'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/spi/spi.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'spi: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/spi'
module_pathname = 'spi'
relocatable = false
superuser = false
schema = 'spi'
2 changes: 1 addition & 1 deletion pgrx-examples/spi_srf/spi_srf.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'spi_srf: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/spi_srf'
module_pathname = 'spi_srf'
relocatable = false
superuser = false
schema = 'spi_srf'
2 changes: 1 addition & 1 deletion pgrx-examples/srf/srf.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'srf: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/srf'
module_pathname = 'srf'
relocatable = false
superuser = false
schema = srf
2 changes: 1 addition & 1 deletion pgrx-examples/strings/strings.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'strings: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/strings'
module_pathname = 'strings'
relocatable = false
superuser = false
schema = strings
2 changes: 1 addition & 1 deletion pgrx-examples/triggers/triggers.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'triggers: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/triggers'
module_pathname = 'triggers'
relocatable = false
superuser = false
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'versioned_custom_libname_so: Created by pgrx'
default_version = '@CARGO_VERSION@'
# commenting-out module_pathname results in this extension being built/run/tested in "versioned shared-object mode"
# module_pathname = '$libdir/versioned_othername'
# module_pathname = 'versioned_othername'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/versioned_so/versioned_so.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'versioned_so: Created by pgrx'
default_version = '@CARGO_VERSION@'
# commenting-out module_pathname results in this extension being built/run/tested in "versioned shared-object mode"
# module_pathname = '$libdir/versioned_so'
# module_pathname = 'versioned_so'
relocatable = false
superuser = false
2 changes: 1 addition & 1 deletion pgrx-examples/wal_decoder/wal_decoder.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
comment = 'wal_decoder: Created by pgrx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/wal_decoder'
module_pathname = 'wal_decoder'
relocatable = false
superuser = true
trusted = false
2 changes: 1 addition & 1 deletion pgrx-sql-entity-graph/src/pgrx_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl PgrxSql {
let extname = &self.extension_name;
let extver = &self.control.default_version;
// Note: versioned so-name format must agree with cargo pgrx
format!("$libdir/{extname}-{extver}")
format!("{extname}-{extver}")
} else {
String::from("MODULE_PATHNAME")
}
Expand Down
2 changes: 1 addition & 1 deletion pgrx-tests/pgrx_tests.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'tests: Created by pgrx'
default_version = '1.0'
module_pathname = '$libdir/pgrx_tests'
module_pathname = 'pgrx_tests'
relocatable = false
superuser = false
Loading