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

Provider does not handle arguments of type array in functions correctly

Open VasileiosGi opened this issue 1 year ago • 1 comments

Hi there,

Terraform Version

1.5.7

Affected Resource(s)

postgresql_function

Description

When creating a resource of type postgresql_function if there is an argument of type array with several values as default the resource is correctly applied but in state only the first value exists. For example given an arg with:

default = "ARRAY['sth'::text , 'sth_else'::text]"
type     = "character varying[]"

the resource is correctly applied but in state it is registered as

default = "ARRAY['sth'::text"

Expected Behavior

What should have happened?

default = "ARRAY['sth'::text , 'sth_else'::text]"

Actual Behavior

What actually happened?

default = "ARRAY['sth'::text"

This must be related with this line of code.

VasileiosGi avatar Mar 07 '24 08:03 VasileiosGi

If the ARRAY has only 1 element, plan/apply goes through as expected and there's no drift reported afterwards

kirkiris avatar Mar 07 '24 10:03 kirkiris