Skip to content

Add pgtle.set_extension_schema() to set an extension's schema#311

Open
jim-mlodgenski wants to merge 1 commit into
aws:mainfrom
jim-mlodgenski:add-set-extension-schema
Open

Add pgtle.set_extension_schema() to set an extension's schema#311
jim-mlodgenski wants to merge 1 commit into
aws:mainfrom
jim-mlodgenski:add-set-extension-schema

Conversation

@jim-mlodgenski

Copy link
Copy Markdown
Contributor

Issue #, if available: #301

Description of changes:

Schema support added in pg_tle 1.5 stores the target schema in an
extension's control function, but there was no way to set or change it
afterward. An extension installed before 1.5, or with the wrong schema,
could only adopt one by uninstalling and reinstalling, which drops any
data in its tables.

This change adds pgtle.set_extension_schema(name, schema), which
rewrites just the control function in place. It takes the schema as
text (matching install_extension's schema argument, which likewise only
records the name) and accepts NULL to clear it; an empty string is
rejected. The change affects future CREATE EXTENSION calls; an
already-created extension is left untouched. The new function ships in a
1.5.2--1.5.3 upgrade script, with regression coverage in
pg_tle_extension_schema and documentation in 03_managing_extensions.md.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Schema support added in pg_tle 1.5 stores the target schema in an
extension's control function, but there was no way to set or change it
afterward. An extension installed before 1.5, or with the wrong schema,
could only adopt one by uninstalling and reinstalling, which drops any
data in its tables.

Add pgtle.set_extension_schema(name, schema), which rewrites just the
control function in place. It takes the schema as text (matching
install_extension's schema argument, which likewise only records the
name) and accepts NULL to clear it; an empty string is rejected. The
change affects future CREATE EXTENSION calls; an already-created
extension is left untouched.

Fixes aws#301.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant