Postgres gets support for upsert
git.postgresql.org
Postgres gets support for upsert
1–10 of 114 posts
Re: Postgres gets support for upsert
#2This was the most requested feature in PostgreSQL: https://postgresql.uservoice.com/forums/21853-general
Re: Postgres gets support for upsert
#3Re: Postgres gets support for upsert
#4I was so surprised when I ran into the lack of this feature as I'd had it on both MSSQL and MySQL.
Re: Postgres gets support for upsert
#5This is actually huge. A common problem that arises when you write applications is you want to INSERT if key does not exist else UPDATE. The right way of doing this without an upsert is using a transaction. However this will make life easier as you can do it directly in one SQL statement.
Re: Postgres gets support for upsert
#6Re: Postgres gets support for upsert
#7Re: Postgres gets support for upsert
#8This is actually huge. A common problem that arises when you write applications is you want to INSERT if key does not exist else UPDATE. The right way of doing this without an upsert is using a transaction. However this will make life easier as you can do it directly in one SQL statement.
i've seen a system in mysql do "insert on duplicate key update" for ages, so this is that same pattern?
Re: Postgres gets support for upsert
#9I try not to think too deeply about all the DB internals (some people are much smarter than me about this stuff), but clearly there are a lot of things that need maintained internally to make this correct, so kudos to all the people who contributed to this.