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

refactor: use oid=?::regtype when fetching pg_type by name instead of joining pg_namespace #3244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vlsi
Copy link
Member

@vlsi vlsi commented May 12, 2024

This makes the query simpler, and it aligns the lookup semantics with the one of the database.

There is a couple of places where TypeInfoCache still uses typname = ?, however, I am not sure regarding their semantics, so making a small change for now.

… joining pg_namespace

This makes the query simpler, and it aligns the lookup semantics with the one
of the database.
@vlsi
Copy link
Member Author

vlsi commented May 12, 2024

The change is not compatible with the previous behavior. However, I believe the incompatibility is subtle enough so we can ship it without a connection property.

The database uses search_path to lookup the type, however, previously a type from any schema could match.

See b383f6d

I think we should follow the DB behavior, and we should support only the types listed on the search_path (== use DB's ::regtype cast)

@davecramer
Copy link
Member

I agree that the change will be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants