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

Possible wrong Postgres query on ADDITIONAL_TABLE_ATTRIBUTES.sql #998

Closed
marciomed1 opened this issue Jan 20, 2023 · 2 comments
Closed

Possible wrong Postgres query on ADDITIONAL_TABLE_ATTRIBUTES.sql #998

marciomed1 opened this issue Jan 20, 2023 · 2 comments
Assignees
Labels

Comments

@marciomed1
Copy link

marciomed1 commented Jan 20, 2023

Description

The query on ADDITIONAL_TABLE_ATTRIBUTES seems to search for tables and it's schema, but the join between the tables and the schema is done by table's owner, which seems wrong.

Original join:

ON C.RELOWNER = NC.NSPOWNER

Join to fetch table's schema should be:

ON c.relnamespace = nc.oid

The way the query is written returns way more rows than expected with a hundred of schemas of the same owner.
We are comming here from another project, where this query is causing too much execution delay.
I'm not sure if the query should really return the schema of the table, or it's Obevo who's using it the wrong way.

How to Reproduce

No response

Relevant log output

No response

SchemaCrawler Version

Latest

Java Version

Latest

Operating System and Version

Any

Relational Database System and Version

Postgres

JDBC Driver and Version

Any

@sualeh
Copy link
Collaborator

sualeh commented Jan 20, 2023

Thanks. I will take a look.

sualeh added a commit that referenced this issue Jan 20, 2023
sualeh added a commit that referenced this issue Jan 21, 2023
* Fix issue #998 - match on table OID

* Make SQL consistent in object naming patterns
@sualeh
Copy link
Collaborator

sualeh commented Jan 21, 2023

@marciomed1 - this will be fixed in the next release of SchemaCrawler. Thanks for reporting it.

@sualeh sualeh closed this as completed Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants