CREATE TABLE history_0 AS
WITH moved_rows AS (
DELETE FROM current
WHERE current.date < (now() - '6 Months'::interval)
RETURNING * -- or specify columns
)
SELECT * FROM moved_rows;
snippets/postgresql.1476094717.txt.gz · Last modified: (external edit)