ddgs <gsmaths(at)gmail(dot)com> wrote:
> It is just a simple idea syntax, not the exact one.
Then it doesn't seem possible to give an exact answer as to what it
will do. The effect on transaction IDs will depend on whether
you're talking about one DELETE statement with a range of values in
the WHERE clause or a series of DELETE statements, one for each row,
which are not bounded by a transaction through some other means.
> Anyway, I am wonder how to get the 2^31 transaction IDs to cause
> the failure
One of the easiest ways to get to such a failure is to disable
autovacuum or make it less aggressive.
> But I get the wraparound error warning when I delete a large no.
> of rows. So the wraparound failure is due to what reason, that I
> still have no idea (at least not the transaction limit, I guess)
>From what little information you've provided, it's hard to tell. It
might be that the DELETEs are generating a very large number of
database transactions, each of which is consuming a transaction ID.
It might be that your DELETE is running for so long that it's
interfering with autovacuum's ability to clean up after a high
volume of other transactions. It could be that you are simply not
vacuuming aggressively enough, and the DELETE happened to come along
at the point where the issue became critical, and is thus an
"innocent bystander" and not the culprit.
-Kevin