[Postgres-xl-general] Move data from one table to another

asvany asvany at gmail.com
Mon Feb 15 07:01:22 PST 2016


Hi ,

when I try this commonly used pattern:

WITH deleted AS (
   DELETE FROM a RETURNING *
) INSERT INTO b SELECT * FROM deleted ON CONFLICT DO NOTHING;

I just get an error:

ERROR: INSERT/UPDATE/DELETE is not supported in subquery
SQL state: 0A000


Can a safe workaround the following:

BEGIN TRANSACTION;
INSERT INTO b SELECT * FROM a ON CONFLICT DO NOTHING;
DELETE FROM a ;
COMMIT TRANSACTION;

Thanks,
As





More information about the postgres-xl-general mailing list