Skip to content

Conversation

eeeebbbbrrrr
Copy link
Contributor

It's entirely possible for a pgrx extension to have functions like this:

mod a {
   #[pg_extern]
   fn foo() { }
}

mod b {
   #[pg_extern]
   fn foo() { }
}

These are two distinct functions in Rust, and should be in the SQL schema, but the naming of the sql entity graph __pgrx_internals_fn_* function isn't unique enough and causes compilation problems.

We could maybe include the schema name here, but I don't think that's quite enough, so instead we just append a UUIDv4 value.

eeeebbbbrrrr and others added 5 commits August 21, 2025 10:44
It's entirely possible for a pgrx extension to have functions like this:

```rust
mod a {
   #[pg_extern]
   fn foo() { }
}

mod b {
   #[pg_extern]
   fn foo() { }
}
```

These are two distinct functions in Rust, and should be in the SQL
schema, but the naming of the sql entity graph `__pgrx_internals_fn_*`
function isn't unique enough.

We could also include the schema name there, but I don't think that's
quite enough, so instead we just append a UUIDv4 value.
@usamoi
Copy link
Contributor

usamoi commented Sep 25, 2025

These are two distinct functions in Rust, and should be in the SQL schema, but the naming of the sql entity graph __pgrx_internals_fn_* function isn't unique enough and causes compilation problems.

Why don't two _wrapper functions and two pg_finfo_ functions conflict too?

@eeeebbbbrrrr
Copy link
Contributor Author

Why don't two _wrapper functions and two pg_finfo_ functions conflict too?

They do! But that's not what I'm trying to fix here. There'd be no way to "fix" what you're describing without changing how we name every exported #[pg_extern] symbol, and that seems like a bad idea.

@eeeebbbbrrrr
Copy link
Contributor Author

I'll leave this PR for now.

I'm trying to get f-ing CI to work so I can release support for pg18.

@eeeebbbbrrrr eeeebbbbrrrr marked this pull request as draft September 25, 2025 15:21
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.

2 participants