Using Bulk Upsert with multiple new records

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 :blush: 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 :slight_smile: 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.

1 Like

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.
Screenshot 2024-03-05 at 10.27.06 AM