Skip to content

allow upgrading with ALTER EXTENSION pg_jsonschema UPDATE#95

Open
terencehonles wants to merge 1 commit intosupabase:masterfrom
terencehonles:add-missing-upgrade-sql-files
Open

allow upgrading with ALTER EXTENSION pg_jsonschema UPDATE#95
terencehonles wants to merge 1 commit intosupabase:masterfrom
terencehonles:add-missing-upgrade-sql-files

Conversation

@terencehonles
Copy link
Contributor

What kind of change does this PR introduce?

allow upgrading with ALTER EXTENSION pg_jsonschema UPDATE

What is the current behavior?

PostgreSQL complains that there is no upgrade path for the extension and refuses to update it:

# ALTER EXTENSION pg_jsonschema UPDATE;
ERROR:  extension "pg_jsonschema" has no update path from version "0.3.3" to version "0.3.4"

The only way to update is to drop and then re-create the extension. This isn't generally needed because in most cases there isn't any changes that PostgreSQL needs to know about so the updated .so file is OK to use even though the extension is not reported to be updated.

In a couple of upgrade SQL files I added you'll notice that there is some changes that would not be visible after updating.

What is the new behavior?

The extension is properly updated

Additional context

@terencehonles
Copy link
Contributor Author

@imor do you mind looking this over? This may not need to force a new release if users are only going between recent releases, but this change unblocks upgrading through all the versions I found on the GitHub releases page (I tested it with a demo server and confirmed that the exposed functions and their definitions were updated properly).

You'll probably want to add an upgrade file check to your release scripts, and I downloaded and extracted the debs from the release page, but it probably makes sense to check in the last release's SQL so it's easier to figure out what the difference is between the versions.

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