I have a table named 'plot' which has columns such as 'id','tablename','geom','description'. I need to populate the geom and description of the plot table from the same table itself based on specific condition.For ex select geom,description from plot where id=2;But need to populate other tow columns 'id', and 'tablename' with different values.Is that possible in postgresql?
Sure, something like
INSERT INTO plot (id, tablename, geom, description)
SELECT 42, 'mytablename', p.geom, p.description
FROM plot p
WHERE id = 2;