update column postgresql code example

Example 1: alter column in table postgres

ALTER TABLE table_name
  ALTER COLUMN column_name TYPE column_definition;

Example 2: update value postgresql

UPDATE table
SET column1 = value1,
    column2 = value2 ,...
WHERE
	condition;

Example 3: update column data type postgres

ALTER TABLE table_name
ALTER COLUMN column_name [SET DATA] TYPE new_data_type;

Example 4: update record in postgreps

UPDATE table_name
SET column1 = value1,
    column2 = value2,
    ...
WHERE condition;

Tags:

Sql Example