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 schema names with dashes #7

Open
zcmarine opened this issue Mar 27, 2018 · 1 comment
Open

Support schema names with dashes #7

zcmarine opened this issue Mar 27, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@zcmarine
Copy link
Contributor

Summary
Postgres doesn't like dashes in identifiers. To solve this, we can double-quote identifiers. We currently do this for tables and rolenames, but we don't do it for schemas. As a result, a spec like the below will cause an error:

zmarine:
    can_login: true
    owns:
        schemas:
            - schema-with-dash
    privileges:
        tables:
            read:
                - schema-with-dash.*

Postgres will complain that there is a syntax error at or near "-". To resolve this, we should double-quote all schemas as well.

Key Actions

  • Identify all places where schemas are used and ensure they are double-quoted. This will likely just be modifying the queries within context.py to make sure they all double-quote schemas, but there may be downstream places that do comparisons / lookups of a schema and don't double-quote it.
  • In addition, the submodules that use schemas (ownerships.py and privileges.py) will need to quote schemas that they are working with to make sure lookups with context.py work properly.
  • This is true for all other issues as well, but we definitely want a test here to verify that this behavior works as expected.
@Gastove
Copy link

Gastove commented Jul 20, 2018

Ah. Totally missed this in my cursory glance over the issue tracker. Erghm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants