Re: BUG #6571: Postgres Kills 'Select 1' query randomly on hot standby databases

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "Alex Matzinger" <amatzinger(at)experts-exchange(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6571: Postgres Kills 'Select 1' query randomly on hot standby databases
Date: 2012-04-03 16:41:38
Message-ID: 4F7AE1F20200002500046B1C@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alex Matzinger <amatzinger(at)experts-exchange(dot)com> wrote:

> The connection that is executing the SELECT 1 are generally open
> for 1-5 hours before they are killed. The specific connection
> only executes SELECT 1. The transaction is simply BEGIN, and then
> SELECT 1's, no other query is executed.

Don't do that.

In particular, never put more into a single database transaction
than is required for integrity; and there is no apparent reason why
running a series of "SELECT 1" statements needs to be in a single
transaction. (It's not blindingly obvious why you would want to do
it in general, but I can imagine it possibly being useful for
monitoring purposes.)

-Kevin

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message John R Pierce 2012-04-03 16:50:38 Re: BUG #6571: Postgres Kills 'Select 1' query randomly on hot standby databases
Previous Message Tom Lane 2012-04-03 16:40:12 Re: BUG #6571: Postgres Kills 'Select 1' query randomly on hot standby databases