Re: Question about Idle in TX

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Kerr <dmk(at)mr-paradox(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question about Idle in TX
Date: 2010-08-03 19:49:57
Message-ID: 27857.1280864997@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Kerr <dmk(at)mr-paradox(dot)net> writes:
> for example: If a java program connects to the DB and does "begin;"
> and then internally does a "sleep 6 days"

> Does that cauz any issues other than eating a connection to the database?

In recent versions of PG, no. Before about 8.3 it was a Really Bad Idea,
because the open transaction would prevent VACUUM from reclaiming storage.

It's *still* a Really Bad Idea to begin a transaction, do something,
and then sleep 6 days. But "BEGIN" without any following commands
has been fixed to be harmless, mainly because there are so many
badly designed clients that do exactly that ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2010-08-03 19:50:03 Re: Finding the primary key of tables
Previous Message George Silva 2010-08-03 19:38:04 Re: Finding the primary key of tables