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

SQL_IDENTIFIER_RE issue #77

Closed
jseabold opened this issue Dec 15, 2015 · 3 comments
Closed

SQL_IDENTIFIER_RE issue #77

jseabold opened this issue Dec 15, 2015 · 3 comments

Comments

@jseabold
Copy link
Collaborator

I have encountered table names that look like schema.table.name and reflection is breaking because SQL_IDENTIFER_RE.findall(key) returns a list of length 3 in dialect._get_schema_and_relation.

@jseabold
Copy link
Collaborator Author

Seems like you may be able to get away with something like this since the schema / relation split doesn't need to meet the redshift identifier rules.

identifiers = re.split("\.", key, 1)

@graingert
Copy link
Member

Do you have the example DDL?

jseabold added a commit to jseabold/sqlalchemy-redshift that referenced this issue Dec 15, 2015
@jseabold
Copy link
Collaborator Author

What else you need? The relname from pg_catalogue.pg_class for an ordinary table is 'schema.schema.table', so it was created with something like

create table schema."stupid.name" (id int);

and the relname won't reflect the quotes, when you query pg_catalog.pg_class.

jseabold added a commit to jseabold/sqlalchemy-redshift that referenced this issue Dec 15, 2015
jseabold added a commit to jseabold/sqlalchemy-redshift that referenced this issue Dec 15, 2015
jseabold added a commit to jseabold/sqlalchemy-redshift that referenced this issue Apr 28, 2016
jseabold added a commit to jseabold/sqlalchemy-redshift that referenced this issue Apr 28, 2016
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

No branches or pull requests

2 participants