Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension upgrades discussion #1960

Closed
gonzalezzfelipe opened this issue Dec 12, 2024 · 2 comments
Closed

Extension upgrades discussion #1960

gonzalezzfelipe opened this issue Dec 12, 2024 · 2 comments

Comments

@gonzalezzfelipe
Copy link

Hey there,

We at TxPipe are developing Mumak, an extension to interact with Cardano CBOR data directly.

Upgrades are a pain for us because we have many indexes that depend on the extension. Therefore, when updating the extension (even if the update solely involves adding some functions), we see no option but to drop cascade the extension, loosing all the indexes, and then having to recreate them (~10 hours).

With that in mind I was wondering:

  • The first item on the TODO list is Automatic extension schema upgrade scripts, how close to being ready is that feature?
  • Is there an alternative that we are not seeing to improve how we do the extension upgrades?

For know, what we were thinking is to generate many subextensions (mumak-blocks, mumak-txs, mumak-utxos, mumak-addresses, mumak-misc) and then handle the updates as we do now, with the benefit of having smaller blast radiuses.

Looking forward to read what you have to say about this, it would be very benefitial for us to improve the upgrade flow.

@workingjubilee
Copy link
Member

The first item on the TODO list is Automatic extension schema upgrade scripts, how close to being ready is that feature?

When that TODO list was drafted, it was assumed that pgrx would develop in a different way than it has. It is not actually on the roadmap AFAIK.

@eeeebbbbrrrr
Copy link
Contributor

Is there an alternative that we are not seeing to improve how we do the extension upgrades?

You can make your own extname--oldver--newver.sql upgrade scripts, following the outline provided by the Postgres documentation for extension upgrade scripts. You put them in your crate's sql/ directory, and pgrx will properly manage the files.

You have to write them yourself, but that's at least consistent with how C/PGXS-based extensions work.

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

No branches or pull requests

3 participants