Skip to content

Add MAINTAIN privilege in resource "postgresql_grant" #573

@DavydDerkach

Description

@DavydDerkach

Hi everyone,

I’m trying to grant the MAINTAIN privilege (introduced in PostgreSQL 17) using the your provider.
With version 1.21.0, adding MAINTAIN into the privileges argument list fails with validation errors.

My example code:

resource "postgresql_grant" "role_grant_table" {
  role        = "all_role_maintain"
  database    = "db_game_service"
  schema      = "public"
  object_type = "table"
  privileges  = ["SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES", "TRIGGER", "MAINTAIN"]
}

Error that I receive:

Error: MAINTAIN is not an allowed privilege for object type table
│
│   with postgresql_grant.role_grant_table["all_role_maintain-db_game_service"],
│   on main.tf line 57, in resource "postgresql_grant" "role_grant_table":
│   57: resource "postgresql_grant" "role_grant_table"

May someone help me to resolve this issue or explain what I am doing wrong?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions