Same here... Whats the status?
Hey everyone! This definitely seems like something we should look into supporting, so I went ahead and created an internal bug report for this. Once there are any updates there, I'll make sure to update this thread Truly thank you for all your input here!
Hi @victoria,
thanks for your feedback.
I guess this topic is also related to it:
http://community.retool.com/t/sql-upsert-does-not-allow-for-default-values/6016/7
So maybe it makes sense to add it to the internal bug report.
Greetings,
Korbinian
Hi @victoria,
is there any update on a timeline when we can expect the feature?
Greetings,
Korbinian
Hi @Korbinian123! Let me check Will let you know once I hear back
OP here. Still no answer? I have a different implementation but the same problem. Can't "upsert" because the "undefined" primary key "id" shows as duplicate for all "new" records.
Hey @troot I asked the eng team in charge of resources about this, will let you know once I hear back.
Quick update! It appears that we support undefined keys for Postgres (as well as MySQL and MS SQL) only for Bulk Upsert by Key
actions. It turns out that Postgres enforces non null constraint on the primary key col by default, so null is bound to fail and it would be okay to treat null similar to undefined ie let the default auto increment behavior for id generation work here.
Let me know if you understand things differently, and I'd be happy to talk about it with our eng team!
@victoria still running into this issue. Was there a fix/workaround posted somewhere that you could point me to?
When passing null to my upsert query, I'm getting a "Primary key id is not unique in the supplied array. The following keys were duplicated: null" error. I have the "id" field set as the primary key and to auto-increment.
See screenshots for the query, error, and value I'm passing as the update array.
I am using the Snowflake resource. Still having the exact error with Primary key is set.
For "Array of records to update", I used:
{{ [
...table1.newRows,
...table1.changesetArray,
] }}
Hi @edwardfung123,
Thanks for chiming in! For the time being, I'd recommend two different bulk queries (insert & update) instead of a bulk upsert.
How is your primary key set up configured in Snowflake? If the database has auto increment configured for the primary key, objects in the array with undefined primary key values should be inserted as new rows and assigned a value.