PostgreSQL Update

PostgreSQL Update

The PostgreSQL UPDATE statement is used to modify values in a table.

Update syntax

UPDATE table_name
SET
column_n1 = new_value1,
column_n2 = new_value2,
column_n3 = new_value3,
...
WHERE {condition}

Update example

UPDATE goods 
SET description = 'Car 2 description' 
WHERE id = 2 AND name = 'Car_2';

UPDATE goods 
SET 
name = 'Boat_123',
description = 'Boat 123 dsp' 
WHERE id = 4 AND name = 'Boat_1';