Update SET

Update Set is a useful SQL query to update certain columns with a specific value or values created by another SQL query.

A simple example would be:

UPDATE tablename SET column1 = 'ABC';
COMMIT;

Or if you are updating multiple columns then it would look something like this:

UPDATE tablename SET
column1 = 'ABC',
column2 = 3,
column3 = 'Lemons';
COMMIT;

However a big thing to note is that when you do a UPDATE SET actually creates a copy of each row, which for large database tables can be massive.

So you must run VACCUM ANALYZE FULL after running the UPDATE staetement. This will release the old rows and give you back your space.