Skip to content

Obscured runtime extension patching and migrations #1533

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

Open
steve-chavez opened this issue Apr 8, 2025 · 0 comments
Open

Obscured runtime extension patching and migrations #1533

steve-chavez opened this issue Apr 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@steve-chavez
Copy link
Member

steve-chavez commented Apr 8, 2025

Problem

At create extension time, several extensions are patched and migrations are applied to them. This is hard to see and maintain.

For example:

Additionally:

  • Whenever one of the custom scripts has bad syntax, the error message is complicated and unhelpful:
PL/pgSQL function inline_code_block line 1 at EXECUTE
SQL statement "    do $_$    begin      execute replace(replace(replace(replace(            pg_read_file('/build/tmp.RwJWZ0twg6/extension-custom-scripts/pgmq/after-create.sql')          >
Error executing SQL file

Solution

Nix has a standard patches attribute which can be used. Which is much more visible and doesn't happen at runtime, but at "release" time.

Migrations should have a SSoT and that should be the migrations subdir.


It seems that this practice was adopted before Nix was introduced.

Following this, supautils custom scripts should likely be gone too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant