-
Notifications
You must be signed in to change notification settings - Fork 177
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
PostgresTypes returns types that aren't visible in the current schema #357
Comments
We should be doing what PGJDBC does. /cc @davecramer |
PGJDBC only keeps the first match for a name, .. I was naively assuming (looking at the API surface) that I'd only get a single result for a name out of
|
Also, if using the provided |
@osi Since it is actually possible to have a valid type with the same name in two different active schemas it seems to me that we need to return a schema qualified type. Thoughts? |
@davecramer that'd be the least ambiguous option when there are multiple active schemas. (that's actually how I discovered this problem, when the server gave me an error with the schema-qualified name that it was seeing vs expected) |
@osi OK, I'll take a run at implementing that, unless you have some cycles ? |
I'l have cycles by end-of-year, if that timeframe works. |
if it's still around by then, have at it. |
I went to work on this and realized it isn't a problem with enums. My initial observation was with a custom type, and I was using If anything I'd say we could do this,
.. using |
PostgresTypes
does aLEFT JOIN
against the namespaces, resulting in multiple types being returned if the type is defined in multiple namespacesr2dbc-postgresql/src/main/java/io/r2dbc/postgresql/codec/PostgresTypes.java
Lines 38 to 39 in ff5c93c
I have a type that is defined in multiple schemas (the schema is a "version", and application code is only using a specific version). This is controlled by the active schema, and
current_schemas
will only return a single one. If I have a type defined in 3 schemas, I will receive three results fromPostgresTypes
as it does aLEFT JOIN
against the visible namespaces rather than anINNER JOIN
.If the
LEFT JOIN
behavior is desired, adding the namespace to the returned object would allow filtering in application code.The text was updated successfully, but these errors were encountered: