Skip to content

add schema support in derive - #1340

Open
purple-ic wants to merge 2 commits into
rust-postgres:masterfrom
purple-ic:master
Open

purple-ic wants to merge 2 commits into
rust-postgres:masterfrom
purple-ic:master

Conversation

@purple-ic

Copy link
Copy Markdown

#[postgres(schema = ...)] can be used to make it so the type only accepts types with the matching schema name. if the attribute is omitted, any schema is allowed (same as before).

unfortunately this adds tests that create non-temporary types (because we use our own schemas, and afaik temporary things are only possible under pg_temp_* schemas). the tests fail if you run cargo test twice with the same database (though it seems there were already a few tests with this issue). lmk if there's a fix.

also for whatever reason the postgres::test::is_closed test fails on my machine? i can only assume this is a bug with the test suite or some issue with my setup, because i touched absolutely nothing that would affect that...

fixes #627

#[postgres(schema = ...)] can be used to make it so the type only accepts types with the matching schema name. if the attribute is omitted, any schema is allowed (same as before).

fixes rust-postgres#627
@purple-ic
purple-ic marked this pull request as draft April 18, 2026 03:13
@purple-ic

Copy link
Copy Markdown
Author

actually hold on: i guess i could make the schemas use a pg_temp_ prefix

@purple-ic

purple-ic commented Apr 18, 2026

Copy link
Copy Markdown
Author

ah, nevermind, you can't create your own pg_ schemas. the issue remains

@purple-ic
purple-ic marked this pull request as ready for review April 18, 2026 03:17
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.

Handle schema-qualified names in derive

1 participant