In postgresql, how to INSERT values in a column.b from column.a from same table Where
IF column.a = 1 then column.b = foo,
IF column.a = 2 then column.b = bar,
IF column.a = 3 then column.b = good,
IF column.a = 4 then column.b = bad
INSERT does not insert values into columns. It inserts new rows into your table. Instead, you need to use an UPDATE statement. You will also need some ifs inside.