You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
column {
name="_TS_CREATED"nullable=falsetype="TIMESTAMP_TZ"comment="The timestamp when the record was created."default {
expression="CURRENT_TIMESTAMP()"
}
}
Category
category:resource
Object type(s)
resource:table
Expected Behavior
A column _TS_CREATED is created, and its default value should be the output of the CURRENT_TIMESTAMP() expression.
Actual Behavior
apply fails with the following error:
╷
│ Error: failed to add column _TS_CREATED => Only adding a column as a constant is supported by Snowflake
│
│ with snowflake_table.user_tenants,
│ on settings_data.tf line 154, in resource "snowflake_table" "user_tenants":
│ 154: resource "snowflake_table" "user_tenants" {
│
╵
Steps to Reproduce
Create a snowflake_table resource which includes a column with a default block with an expression inside
Run apply
How much impact is this issue causing?
Low
Logs
No response
Additional Information
No response
Would you like to implement a fix?
Yeah, I'll take it 😎
The text was updated successfully, but these errors were encountered:
To clarify, we are not trying to add a column to an existing table, but to create a new table which includes the column with a default expression. Looking at the doc it should be possible? https://docs.snowflake.com/en/sql-reference/sql/create-table
Yes, it should be possible, and we even have a test case for this :) But the message you got is returned only in the update function, so that shouldn't happen.
Please provide the whole table configuration and logs with TF_LOG=DEBUG.
Terraform CLI Version
opentofu 1.7.2
Terraform Provider Version
0.96.0
Terraform Configuration
Category
category:resource
Object type(s)
resource:table
Expected Behavior
A column
_TS_CREATED
is created, and its default value should be the output of theCURRENT_TIMESTAMP()
expression.Actual Behavior
apply fails with the following error:
Steps to Reproduce
snowflake_table
resource which includes a column with adefault
block with anexpression
insideHow much impact is this issue causing?
Low
Logs
No response
Additional Information
No response
Would you like to implement a fix?
The text was updated successfully, but these errors were encountered: