# Batch Update

DevFeed: [Batch Update](<https://devfeed.tech/articles/batch-update-34497.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2013/03/batch-update/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2013-03-15T09:47:00Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [JOIN](<https://devfeed.tech/topics/join.md>)

Tags: [anti-join](<https://devfeed.tech/tags/anti-join.md>), [batch](<https://devfeed.tech/tags/batch.md>), [performance](<https://devfeed.tech/tags/performance.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

This tutorial explains how to perform efficient batch updates in PostgreSQL. It recommends updating many rows in a single SQL statement, loading application-held data into a temporary table with the COPY protocol, and using joins to update existing rows and insert new ones.

## Source excerpt

Performance consulting involves some tricks that you have to teach over and over again. One of them is that SQL tends to be so much better at dealing with plenty of rows in a single statement when compared to running as many statements, each one against a single row.