Matt
Explore posts from serversDTDrizzle Team
•Created by Matt on 3/27/2024 in #help
Upsert Multiple Rows with Conflicts postgres
Seems like raw SQL does the trick - I'll keep noodling at a cleaner way to build the sql but hey it works.
13 replies
DTDrizzle Team
•Created by Matt on 3/27/2024 in #help
Upsert Multiple Rows with Conflicts postgres
No rush at all but thanks
13 replies
DTDrizzle Team
•Created by Matt on 3/27/2024 in #help
Upsert Multiple Rows with Conflicts postgres
Obviously, a simple for loop works but was wondering if I could do it all in one. Maybe just missing something.
13 replies
DTDrizzle Team
•Created by Matt on 3/27/2024 in #help
Upsert Multiple Rows with Conflicts postgres
Yeah, the guide above goes over that but you'll still overwrite cells in a row if it matches a conflict. Like below the row for user 1 would just be an update of the value1 column but the guide would cause columns value2 and value3 to be zero'd out.
13 replies
DTDrizzle Team
•Created by Matt on 3/27/2024 in #help
Upsert Multiple Rows with Conflicts postgres
I'm thinking I'll just need to iterate over the users since this is still having similar issues of just overwriting rows, which makes sense. The userValues can look like this
where userId 1 is an update and userId 2 is a new user being inserted. When I run do it like the guide all the other values in userId1 are overwritten with nothing when it should really just be updating value1. Might not be possible without a for loop or something but figured I'd ask one more to see if you have thoughts.
13 replies
DTDrizzle Team
•Created by Matt on 3/27/2024 in #help
Upsert Multiple Rows with Conflicts postgres
Oh, nice! That's exactly what I'm looking for. Thank you!
13 replies