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

Unable to use colons in function arg default #456

Open
kinghuang opened this issue Jul 29, 2024 · 0 comments
Open

Unable to use colons in function arg default #456

kinghuang opened this issue Jul 29, 2024 · 0 comments

Comments

@kinghuang
Copy link

Terraform Version

Terraform v1.8.5
on darwin_arm64
+ provider registry.terraform.io/crunchydata/crunchybridge v0.2.0
+ provider registry.terraform.io/cyrilgdn/postgresql v1.22.0
+ provider registry.terraform.io/hashicorp/google v5.38.0

Affected Resource(s)

  • postgresql_function

Terraform Configuration Files

resource "postgresql_function" "test" {
  name     = "colon_test"
  schema   = postgresql_schema.dlph_ml.name
  language = "sql"
  returns  = "text"

  arg {
    name    = "colon"
    type    = "text"
    default = "a:b"
  }

  body = <<-EOF
    select colon
  EOF
}

Debug Output

https://gist.github.com/kinghuang/092e1b872bf2189b8ffb9e8a821f0d25

postgresql_function.test: Creating...
2024-07-29T16:48:17.762-0600 [INFO]  Starting apply for postgresql_function.test
2024-07-29T16:48:17.762-0600 [DEBUG] postgresql_function.test: applying the planned Create change
2024-07-29T16:48:20.871-0600 [ERROR] provider.terraform-provider-postgresql_v1.22.0: Response contains error diagnostic: diagnostic_detail="" diagnostic_severity=ERROR diagnostic_summary="pq: syntax error at or near \":\"" tf_req_id=0476afa9-f66e-a1c0-2b50-0886b63ab969 tf_resource_type=postgresql_function tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:55 @module=sdk.proto tf_proto_version=5.3 tf_provider_addr=provider timestamp=2024-07-29T16:48:20.871-0600

Panic Output

None

Expected Behavior

A PostgreSQL function should be created.

Actual Behavior

A syntax error at the colon.

│ Error: pq: syntax error at or near ":"
│ 
│   with postgresql_function.test,
│   on functions_vertexai.tf line 1, in resource "postgresql_function" "test":
│    1: resource "postgresql_function" "test" {
│ 
╵

Steps to Reproduce

Given the above postgresql_function resource with an arg containing a colon in the default, attempt to apply to a PostgreSQL database.

Important Factoids

None.

References

Not sure if this is related to #387?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant