-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
pg_schema doesn't work with pg_operator #1301
Labels
Comments
Hey thanks. Could you include the output of |
Sure thing. /*
This file is auto generated by pgrx.
The ordering of items is not stable, it is driven by a dependency graph.
*/
-- src/lib.rs:6
-- pgrx_repro::hello_pgrx_repro
CREATE FUNCTION repro."hello_pgrx_repro"() RETURNS TEXT /* &str */
STRICT
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', 'hello_pgrx_repro_wrapper';
-- src/lib.rs:16
-- pgrx_repro::pg_catalog::concat_strings
CREATE FUNCTION pg_catalog."concat_strings"(
"left" TEXT, /* alloc::string::String */
"right" TEXT /* alloc::string::String */
) RETURNS TEXT /* alloc::string::String */
STRICT
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', 'concat_strings_wrapper';
-- src/lib.rs:16
-- pgrx_repro::pg_catalog::concat_strings
CREATE OPERATOR ==> (
PROCEDURE="concat_strings",
LEFTARG=TEXT, /* alloc::string::String */
RIGHTARG=TEXT /* alloc::string::String */
); |
yup, sure enough. we get the function in the right schema but not the operator. dang. I'll look into this today. Thanks for the report. |
eeeebbbbrrrr
added a commit
to eeeebbbbrrrr/pgrx
that referenced
this issue
Sep 18, 2023
Merged
there's a fix for this up in #1302. We'll get it merged and committed soon. |
eeeebbbbrrrr
added a commit
that referenced
this issue
Sep 19, 2023
This fixes issue #1301 such that the schema generator now schema-qualifies the operator name when generating a `CREATE OPERATOR` statement. It also qualifies the associated function. This allows us to pick up the fact that a `#[pg_operator]` annotation was applied to function in a module with `#[pg_schema]`.
eeeebbbbrrrr
added a commit
that referenced
this issue
Sep 19, 2023
This fixes issue #1301 such that the schema generator now schema-qualifies the operator name when generating a `CREATE OPERATOR` statement. It also qualifies the associated function. This allows us to pick up the fact that a `#[pg_operator]` annotation was applied to function in a module with `#[pg_schema]`.
Released in v0.10.2! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It doesn't seem like pgrx is creating
pg_operator
functions according topg_schema
. I'm able to reproduce this with a minimalpgrx
setup, where I try to define an operator in apg_catalog
module to make it available in the global Postgres namespace.Setup with:
Set schema to
repro
inrgrx_repro.control
:In
src/lib.rs
, add the following:Test with
cargo pgrx run --pgcli
:I expected the
==>
operator to be available right aftercreate extension pgrx_repro;
The text was updated successfully, but these errors were encountered: