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

Upgrading to 0.12.4 #1888

Closed
jawj opened this issue Sep 27, 2024 · 1 comment
Closed

Upgrading to 0.12.4 #1888

jawj opened this issue Sep 27, 2024 · 1 comment

Comments

@jawj
Copy link

jawj commented Sep 27, 2024

Based on the README I think it's is on the immediate roadmap to make this unnecessary. But in the meantime, here's a brief note for anyone having trouble with upgrading from 0.11 to 0.12.

After running cargo pgrx upgrade, I was getting this error:

error: no bin target named `pgrx_embed_myext`

It turned out I also needed to do the following:

  • Create a file src/bin/pgrx_embed.rs containing only the line ::pgrx::pgrx_embed!();.
  • In Cargo.toml:
    • Under [features], delete pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
    • Also under [features], add pg17 = ["pgrx/pg17", "pgrx-tests/pg17" ]
    • Under [lib], Change crate-type = ["cdylib"] to crate-type = ["cdylib", "lib"]
    • Add a new section like the following, but replacing myext with the name of your extension:
[[bin]]
name = "pgrx_embed_myext"
path = "./src/bin/pgrx_embed.rs"
theory added a commit to tembo-io/clerk_fdw that referenced this issue Dec 9, 2024
The build error was:

    error: no bin target named `pgrx_embed_clerk_fdw`.

This is a side-effect of pgrx v0.12.x; pgcentralfoundation/pgrx#1888
documents the fix: adding a no-op embed target in
`src/bin/pgrx_embed_clerk_fdw.rs` and setting `lib.crate-type` to:

    crate-type = ["cdylib", "lib"]

Hopefully this funky workaround can be removed in the future.

The test simply ensures that `CREATE EXTENSION` works; the update to
`extension_ci.yml` ensures it passes on all supported Postgres versions.
@eeeebbbbrrrr eeeebbbbrrrr pinned this issue Dec 31, 2024
@montanalow
Copy link
Contributor

montanalow commented Jan 11, 2025

Just leaving a note for others upgrading since this list helped me. It appears the initialization order from extension_sql! and extension_sql_file! seems to have changed from a default of finalize to bootstrap, so you may need to add the finalize keyword if your sql depends on things in the extension being executed first. e,g,

extension_sql_file!("../sql/schema.sql", name = "schema", finalize);

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