You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, relocatable extensions were disallowed by a check in the
code for the install command. This pull request removes the check, and,
more importantly, changes the behavior in `PgrxSql::schema_alias_of()`
so that it simply never schema-qualifies based on the control file. This
prevents relocatable extensions from trying to schema-qualify with
`@extname@`, which did not get substituted out by Postgres.
This resolves#1626
In general this is only necessary when returning a `Vec<T: PostgresType>`. In this situation, pgrx needs to know that type's
60
-
`oid` (from the `pg_catalog.pg_type` system catalog) and as such, the schema in which that type lives must be on that
53
+
`oid` (from the `pg_catalog.pg_type` system catalog) and as such, the schema in which that type lives must be on that
61
54
function's `search_path`.
62
55
56
+
### Relocatable extensions
57
+
58
+
Previously, PGRX would schema-qualify all of the output of `cargo pgrx schema` if there was a `schema = foo` attribute in your
59
+
extension `.control` file, including items outside of a `#[pg_schema]` macro. However, this meant that pgrx could not support [relocatable extensions](https://www.postgresql.org/docs/current/extend-extensions.html#EXTEND-EXTENSIONS-RELOCATION).
60
+
This is because relocatable extensions' defining characteristic is that they can be moved from one schema to another, and that
61
+
means you absolutely cannot statically determine the schema the extension lives in by reading the control file alone.
62
+
Since this change was implemented, you can now set `relocatable = true` in your control file without issue, and relocatable
63
+
extensions can be moved with a `ALTER EXTENSION your_extension SET SCHEMA new_schema;` query.
0 commit comments