Squarespace / pgbedrock

Manage a Postgres cluster's roles, role memberships, schema ownership, and privileges
https://pgbedrock.readthedocs.io/en/latest/
Other
313 stars 35 forks source link

Support schema names with dashes #7

Open zcmarine opened 6 years ago

zcmarine commented 6 years ago

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

Gastove commented 6 years ago

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