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: support default privileges at the database level #66785

Merged

Commits on Jul 19, 2021

  1. Add SQL Grammar and tree Node for ALTER DEFAULT PRIVILEGES

    Grammar/tree commit only, no logic. Will populate release note
    in commit implementing logic.
    
    Release note: None
    RichardJCai committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    9cb36d1 View commit details
    Browse the repository at this point in the history
  2. sql: support default privileges at the database level

    Release note (sql change): Added support for ALTER DEFAULT PRIVILEGES
    and default privileges stored on databases.
    
    All objects created in a database will have the privilege set defined
    by the default privileges for that type of object on the database.
    The types of objects are TABLES, SEQUENCES, SCHEMAS, TYPES.
    
    Example: ALTER DEFAULT PRIVILEGES GRANT SELECT ON TABLES TO foo
    makes it such that all tables created by the user that executed the
    ALTER DEFAULT PRIVILEGES command will have SELECT privilege on the table
    for user foo.
    
    Additionally, one can specify a role.
    Example: ALTER DEFAULT PRIVILEGES FOR ROLE bar GRANT SELECT ON TABLES TO foo.
    All tables created by bar will have SELECT privilege for foo.
    If a role is not specified, it uses the current user.
    
    See: https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html
    
    Currently, default privileges are not supported on the schema.
    Specifying a schema like ALTER DEFAULT PRIVILEGES IN SCHEMA s will error.
    
    WITH GRANT OPTION is ignored.
    GRANT OPTION FOR is also ignored.
    RichardJCai committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    6e3438f View commit details
    Browse the repository at this point in the history
  3. sql: add default privileges init function, handle nil cases

    Minor fixes from Arul's PR feedback.
    Remove GRANT ALL for types for creator of type.
    
    Release note: None
    RichardJCai committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    58933c5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e74e925 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2021

  1. sql: properly create SQLUsername from sql input

    Release note: None
    RichardJCai committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    78eabf5 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2021

  1. Minor function refactors for default privileges

    Release note: None
    RichardJCai committed Jul 21, 2021
    Configuration menu
    Copy the full SHA
    b2e8805 View commit details
    Browse the repository at this point in the history