Fix composite type loading when record_send is duplicated.#770
Merged
josevalim merged 1 commit intoJun 17, 2026
Merged
Conversation
The type-loading query does return qualified names when they are duplicated,
for example when a user-defined `record_send` is present:
CREATE TYPE my_composite AS (a int, b text);
CREATE FUNCTION public.record_send(integer) RETURNS bytea LANGUAGE sql AS $$ SELECT ''::bytea $$;
Postgrex.query(conn, "SELECT $1::my_composite[]", [[]])
{:error, %Postgrex.QueryError{message: "type `_my_composite` can not be handled by the types module Postgrex.DefaultTypes"}}
This naive fix strips out the `pg_catalog.` prefix to keep only the bare name as expected by Postgrex.
Member
|
💚 💙 💜 💛 ❤️ |
Member
|
This is a pretty cool issue. I’m going to show it to my team as an example of “whatever can happen will happen” |
Contributor
Author
I mean... it kinda makes sense, but duplicating a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The type-loading query does return qualified names when they are duplicated, for example when a user-defined
record_sendis present:This naive fix strips out the
pg_catalog.prefix to keep only the bare name as expected by Postgrex.--
For context, this was reported by a customer of Supabase Realtime and I tried the smallest fix possible to not cause too many changes and not cause any performance impact.