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

Support postgres unquoted identifier handling #74

Closed
snehlsen opened this issue Jan 25, 2019 · 2 comments
Closed

Support postgres unquoted identifier handling #74

snehlsen opened this issue Jan 25, 2019 · 2 comments
Assignees
Labels
bug Unwanted / harmful behavior

Comments

@snehlsen
Copy link
Contributor

Problem

postgres is incompatible to the SQL standard when it comes to identifiers:

The folding of unquoted names to lower case in PostgreSQL is incompatible with the SQL standard, which says that unquoted names should be folded to upper case. Thus, foo should be equivalent to "FOO" not "foo" according to the standard.

(https://www.postgresql.org/docs/current/sql-syntax-lexical.html)

EXASOL is SQL standard compliant: all unquoted identifiers are folded to upper case. Since the adapter is quoting all identifiers (since v1.1.1), there is an upper case / lower case mismatch that leads to an error.

Proposed solution

The postgres adapter dialect converts all identifiers to lower case. This way the virtual schema integration between exasol and postgres will work seamlessly if you don't use quoted upper case identifiers in postgres.
If you have tables with upper case characters in postgres, creating or refreshing the virtual schema will result in an error. You can still create the schema if you set a FORCE_CREATE property when creating the virtual schema.

@snehlsen snehlsen added the bug Unwanted / harmful behavior label Jan 25, 2019
@snehlsen snehlsen self-assigned this Jan 25, 2019
@andrehacker
Copy link
Contributor

I just think if it would be better to make the force more specific. There will likely be other use cases for forcing in future (e.g. unsupported column types is a known problem) and then the user will not find out about potential other problems after setting the force option once for the reason of unsupported qualifiers. I.e. the force could be also named like "ignore all kinds of warnings" which might be too generic.

Also a short note there is the property exception_handling, which is related. Maybe it needs to become a list, but didn't think through...

snehlsen added a commit that referenced this issue Jan 30, 2019
snehlsen added a commit that referenced this issue Feb 5, 2019
snehlsen added a commit that referenced this issue Feb 11, 2019
snehlsen added a commit that referenced this issue Feb 12, 2019
Merge pull request #75 from exasol/postgres_identifiers
Support for unquoted Postgres identifiers (fix for #74)
@snehlsen snehlsen mentioned this issue Feb 13, 2019
snehlsen added a commit that referenced this issue Feb 13, 2019
* fixed postgres identifier bug (#74 )

* automated integration test for postgres

* internal preparations for join pushdown
@snehlsen
Copy link
Contributor Author

Fixed in Adapter v1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
Development

No branches or pull requests

2 participants