tamanna madaan | 18 Aug 2011 11:34

"idle in transaction" postgres connection


Hi All

I am using postgres-8.4.0 on a cluster setup with slony-2.0.4 being used for replication.
Recently , I saw a "idle in transaction" postgres process as below.
 
postgres 13052 14742 0 May13 ? 00:00:00 postgres: slon abc 172.16.1.1(49017) idle in transaction

I wonder what could have lead to that hung postgres process . I googled about it a lot and they say that it could be
because of abrupt netwotk issue between slony and postgres . But in my case slon was connected
to its local postgres database. So, network wont be an issue in this case . Restarting the slon/postgres resolves
the issue. But, there are other processes also in my application  which connect to postgres using psqlODBC . Those
processes can also cause "idle in transaction" postgres connection . I can't afford restarting any of the processes
to resolve this issue. So, I was wondering if I can make use of tcp_keepalives_idle , tcp_keepalives_interval and
tcp_keepalives_count configurations in postgresql.conf to get rid of this "idle in transaction" processes
after a certain amount of time . Will this help or not ??


Thanks...
Tamanna

 

Mark Morgan Lloyd | 19 Aug 2011 19:43
Picon

Listen/notify and ODBC

In early 2009 I asked whether there was a hack to allow PostgreSQL's 
listen/notify commands via ODBC, some while later I believe that 
somebody sent me example code encoded as base64 which erroneously got 
deleted as spam.

Google suggests that several other people have asked about this over the 
years: if anybody still has this example do you think you could post a 
URL where it might be found?

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Gustavo Pinsard | 19 Aug 2011 20:05
Picon
Favicon

Re: Listen/notify and ODBC

Mark,

When you say "listen/notify", do you mean to respond to SQL commands like "CREATE TABLE" or "CREATE DATABASE"?

The reason why I'm asking is that I do this kind of thing all the time from the language I programm, Clarion for Windows.

What are you trying to accomplish?

Gustavo Pinsard

Em 19/08/2011, às 15:00, Mark Morgan Lloyd <markMLl.pgsql-odbc <at> telemetry.co.uk> escreveu:

In early 2009 I asked whether there was a hack to allow PostgreSQL's listen/notify commands via ODBC, some while later I believe that somebody sent me example code encoded as base64 which erroneously got deleted as spam.

Google suggests that several other people have asked about this over the years: if anybody still has this example do you think you could post a URL where it might be found?

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
tamanna madaan | 22 Aug 2011 06:51

Re: "idle in transaction" postgres connection

Can anyone please suggest me on this .


Thanks..
Tamanna

On Thu, Aug 18, 2011 at 3:04 PM, tamanna madaan <tamanna.madaan <at> globallogic.com> wrote:


Hi All

I am using postgres-8.4.0 on a cluster setup with slony-2.0.4 being used for replication.
Recently , I saw a "idle in transaction" postgres process as below.
 
postgres 13052 14742 0 May13 ? 00:00:00 postgres: slon abc 172.16.1.1(49017) idle in transaction

I wonder what could have lead to that hung postgres process . I googled about it a lot and they say that it could be
because of abrupt netwotk issue between slony and postgres . But in my case slon was connected
to its local postgres database. So, network wont be an issue in this case . Restarting the slon/postgres resolves
the issue. But, there are other processes also in my application  which connect to postgres using psqlODBC . Those
processes can also cause "idle in transaction" postgres connection . I can't afford restarting any of the processes
to resolve this issue. So, I was wondering if I can make use of tcp_keepalives_idle , tcp_keepalives_interval and
tcp_keepalives_count configurations in postgresql.conf to get rid of this "idle in transaction" processes
after a certain amount of time . Will this help or not ??


Thanks...
Tamanna

 




--
Tamanna Madaan | Associate Consultant | GlobalLogic Inc.
Leaders in Software R&D Services
ARGENTINA | CHILE | CHINA | GERMANY | INDIA | ISRAEL | UKRAINE | UK | USA

Office: +0-120-406-2000 x 2971

www.globallogic.com



Gmane