Preamble
The PostgreSQL UPDATE statement is used to update existing table entries in a PostgreSQL database.
The syntax for the UPDATE statement when updating a single table in PostgreSQL
UPDATE table
SET column1 = expression1_id | DEFAULT,
column2 = expression2_id | DEFAULT,
…
[WHERE conds];
Parameters and arguments of the statement
- column1, column2 – Columns that you want to update.
- expression1_id, column2_id – New values for assigning column1, column2. Therefore, column1 will be assigned the value expression1, column2 will be assigned the value2, etc.
- DEFAULT – The default value for this particular column in the table. If the default value for a column is not set, the column will be set to NULL.
- WHERE conds – Optional. The conditions that must be met to perform the update. If no conditions are set, all entries in the table will be updated.
Example of how to update a single column
Let’s look at a very simple example of a PostgreSQL UPDATE query.
UPDATE contacts
SET first_name = 'Helen'
WHERE contact_id = 35;
In this example, the value of first_name will be updated to ‘Helen’ in the contacts table, where contact_id is 35.
You can also use the keyword DEFAULT to set the default value for the column.
For example,
UPDATE contacts
SET first_name = DEFAULT
WHERE contact_id = 35;
In this example, the first_name will be updated to the default value for the field in the contacts table, where contact_id is 35. If the default value is not present in the contacts table, the first_name column will be set to NULL.
Example how to update several columns
Consider the UPDATE example for PostgreSQL, where you can update several columns with one UPDATE statement.
UPDATE contacts
SET city = 'Abilene',
state = 'Beaumont'
WHERE contact_id >= 200;
If you want to update multiple columns, you can do so by separating the column/value pairs with commas.
In this PostgreSQL example of UPDATE, the value of the city will be changed to ‘Abilene’ and the state will be changed to ‘Beaumont’ where contact_id is greater than or equal to 200.
PostgreSQL: How to Update Records | Course
About Enteros
IT organizations routinely spend days and weeks troubleshooting production database performance issues across multitudes of critical business systems. Fast and reliable resolution of database performance problems by Enteros enables businesses to generate and save millions of direct revenue, minimize waste of employees’ productivity, reduce the number of licenses, servers, and cloud resources and maximize the productivity of the application, database, and IT operations teams.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
How to Optimize Fashion Sector Growth with Enteros Database Management, AI SQL, Root Cause Analysis, and AIOps Platform
- 23 April 2026
- Database Performance Management
Introduction The fashion sector is evolving rapidly in the era of digital transformation. From fast fashion and global eCommerce platforms to personalized shopping experiences and real-time inventory systems, fashion brands are becoming increasingly data-driven. Today’s fashion companies must manage vast product catalogs, dynamic pricing strategies, omnichannel sales, and ever-changing customer preferences—all while maintaining speed, agility, … Continue reading “How to Optimize Fashion Sector Growth with Enteros Database Management, AI SQL, Root Cause Analysis, and AIOps Platform”
How to Drive Financial Sector Performance with Enteros Database Management Platform and Cloud FinOps Efficiency
Introduction The financial sector is undergoing a massive digital transformation. From real-time payments and mobile banking to AI-driven fraud detection and personalized financial services, institutions are leveraging advanced technologies to stay competitive. However, this transformation brings increasing complexity in managing IT infrastructure, ensuring high system performance, and controlling cloud costs. Financial institutions must operate in … Continue reading “How to Drive Financial Sector Performance with Enteros Database Management Platform and Cloud FinOps Efficiency”
How to Optimize Healthcare Sector Growth Performance with Enteros Database Software, Cost Estimation, Cost Attribution, and RevOps Efficiency
- 22 April 2026
- Database Performance Management
Introduction The healthcare sector is rapidly evolving, driven by digital transformation, data-driven care delivery, telemedicine, and advanced analytics. Hospitals, clinics, and healthcare systems are increasingly dependent on robust IT infrastructures to manage patient data, streamline operations, and deliver high-quality care. However, this transformation introduces a fundamental challenge:how to scale healthcare services efficiently while maintaining system … Continue reading “How to Optimize Healthcare Sector Growth Performance with Enteros Database Software, Cost Estimation, Cost Attribution, and RevOps Efficiency”
How to Optimize eCommerce Growth with Enteros Database Management Platform, AIOps, Performance Management, and Cloud FinOps
Introduction The eCommerce sector has become one of the fastest-growing industries in the digital economy. With the rise of online shopping, mobile commerce, and global marketplaces, businesses are under constant pressure to deliver seamless, personalized, and high-performance digital experiences. However, scaling eCommerce operations is not just about increasing traffic or expanding product catalogs. It requires … Continue reading “How to Optimize eCommerce Growth with Enteros Database Management Platform, AIOps, Performance Management, and Cloud FinOps”