I am trying to delete a row from one table and insert it with some additional data into another. I know this can be done in two separate commands, one to delete and another to i
You cannot do this before PostgreSQL 9.1, which is not yet released. And then the syntax would be
WITH foo AS (DELETE FROM a WHERE id = 1 RETURNING one, two, 5) INSERT INTO b (one, two, num) SELECT * FROM foo;