terraform-provider-postgresql icon indicating copy to clipboard operation
terraform-provider-postgresql copied to clipboard

Support Function Overloading

Open marvin-kolja opened this issue 3 years ago • 0 comments

Hi there, First of all thanks for this awesome repo and for taking the time reading through this issue.

As you may know PostgreSQL supports function overloading. In our team we use that to have multiple functions with the same name doing slightly different things.

Example:

public.resolve_text(text)
public.resolve_text(text, char)

As for now this provider does not support granting such functions execute privileges.

Affected Resource(s)

  • postgresql_grant

Expected Behavior

Grant EXECUTE privilege to specified function.

resource "postgresql_grant" "function" {
  database    = "test_db"
  role        = "test_role"
  schema      = "public"
  object_type = "function"
  objects     = ["resolve_text(text, char)"]
  privileges  = ["EXECUTE"]
}

Actual Behavior

Throws error that function cannot be found:

could not find a function named "public.resolve_text(text, char)"

Steps to Reproduce

  1. Use the resource specified in Expected Behavior
  2. Terraform apply

References

  • #228

marvin-kolja avatar Jul 20 '22 16:07 marvin-kolja