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

Fix continuous aggregate privileges during upgrade #2845

Merged
merged 1 commit into from Jan 27, 2021

Commits on Jan 27, 2021

  1. Fix continuous aggregate privileges during update

    Copy ACL privileges (grants) from the query view (user-facing object)
    to the internal objects (e.g., materialized hypertable, direct view,
    and partial view) when updating the extension to the new version. A
    previous change added such propagation of privileges when executing
    `GRANT` statements, but didn't apply it retrospectively to the
    internal objects of existing continuous aggregates.
    
    Having the right permissions on internal objects is also necessary for
    the watermark function used by real-time aggregation since it queries
    the materialized hypertable directly.
    
    The update script copies the ACL information from the user-facing view
    of every continuous aggregate to its internal objects (including the
    materialized hypertable and its chunks). This is done by direct insert
    into `pg_class` instead of executing a `GRANT` statement in the update
    script, since the latter will record the grant/ACL as an init
    privilege (i.e., the system believes the GRANT is for an extension
    object). The init privilege will prevent this ACL from being included
    in future dump files, since `pg_dump` only includes non-init
    privileges as it believes such privileges will be recreated with the
    extension.
    
    Fixes timescale#2825
    erimatnor committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    eaed20c View commit details
    Browse the repository at this point in the history