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

fix: make sure we select array_in from pg_catalog to avoid duplicate array_in functions fixes Issue #2548 #2552

Merged
merged 4 commits into from Sep 20, 2022

Conversation

davecramer
Copy link
Member

No description provided.

@@ -219,7 +219,7 @@ private String getSQLTypeQuery(boolean typoidParam) {
// (keeping old behaviour of finding types, that should not be found without correct search
// path)
StringBuilder sql = new StringBuilder();
sql.append("SELECT typinput='array_in'::regproc as is_array, typtype, typname, pg_type.oid ");
sql.append("SELECT typinput='pg_catalog.array_in'::regproc as is_array, typtype, typname, pg_type.oid ");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davecramer , do you know if pg_type.typarray != 0 answers that better?
typarray was added in 8.3: https://www.postgresql.org/docs/8.3/catalog-pg-type.html while we support 8.4+

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If typarray is not 0 then it identifies another row in pg_type, which is the "true" array type having this type as element. So it only says that there is an array type for this type.

Copy link
Member

@vlsi vlsi Jun 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed.

Then PG 14 might bring new joy with its typsubscript and typelem (https://www.postgresql.org/docs/14/catalog-pg-type.html).
However, it looks like typelem has a broader meaning than just an array.

@davecramer
Copy link
Member Author

My vague recollection is that it didn't answer everything. I'd like to be proven wrong.

@davecramer davecramer merged commit 7bfff7a into pgjdbc:master Sep 20, 2022
@davecramer davecramer changed the title fix: make sure we select array_in from pg_catalog to avoid duplicate array_in functions fixes #Issue 2548 fix: make sure we select array_in from pg_catalog to avoid duplicate array_in functions fixes Issue #2548 Nov 10, 2023
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.

None yet

2 participants