Re: MOVE - Mailing list pgsql-general

From Tom Lane
Subject Re: MOVE
Date
Msg-id 26502.1105739747@sss.pgh.pa.us
Whole thread Raw
In response to Re: MOVE  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Why not just do it in a single transaction? I don't think you need to
> use SERIALIZABLE at all, I think normal read-committed mode will do
> what you want, no?

> BEGIN;
> INSERT INTO archive (...) SELECT ... FROM active WHERE user_id = ...;
> DELETE FROM active WHERE user_id = ...;
> COMMIT;

No, that's exactly wrong: in read-committed mode the DELETE could delete
rows that were not seen by the SELECT.  It would work in serializable
mode though.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Parsing of backslash in statements via ODBC
Next
From: "Frank D. Engel, Jr."
Date:
Subject: Re: Parsing of backslash in statements via ODBC