Re: [HACKERS] IDLE in transaction introspection

2012-01-20 Thread Magnus Hagander
On Thu, Jan 19, 2012 at 15:42, Fujii Masao masao.fu...@gmail.com wrote: On Thu, Jan 19, 2012 at 10:31 PM, Magnus Hagander mag...@hagander.net wrote: Applied with fairly extensive modifications. I moved things around, switched to using enum instead of int+#define and a few things like that.

Re: [HACKERS] IDLE in transaction introspection

2012-01-19 Thread Magnus Hagander
On Wed, Jan 18, 2012 at 16:35, Scott Mead sco...@openscg.com wrote: On Wed, Jan 18, 2012 at 8:27 AM, Magnus Hagander mag...@hagander.net wrote: On Tue, Jan 17, 2012 at 01:43, Scott Mead sco...@openscg.com wrote: On Mon, Jan 16, 2012 at 6:10 PM, Scott Mead sco...@openscg.com wrote:

Re: [HACKERS] IDLE in transaction introspection

2012-01-19 Thread Fujii Masao
On Thu, Jan 19, 2012 at 10:31 PM, Magnus Hagander mag...@hagander.net wrote: Applied with fairly extensive modifications. I moved things around, switched to using enum instead of int+#define and a few things like that. Also changed most of the markup in the docs - I may well have broken some

Re: [HACKERS] IDLE in transaction introspection

2012-01-18 Thread Magnus Hagander
On Tue, Jan 17, 2012 at 01:43, Scott Mead sco...@openscg.com wrote: On Mon, Jan 16, 2012 at 6:10 PM, Scott Mead sco...@openscg.com wrote: On Sun, Jan 15, 2012 at 4:28 AM, Greg Smith g...@2ndquadrant.com wrote: On 01/12/2012 11:57 AM, Scott Mead wrote: Pretty delayed, but please find the

Re: [HACKERS] IDLE in transaction introspection

2012-01-18 Thread Scott Mead
On Wed, Jan 18, 2012 at 8:27 AM, Magnus Hagander mag...@hagander.netwrote: On Tue, Jan 17, 2012 at 01:43, Scott Mead sco...@openscg.com wrote: On Mon, Jan 16, 2012 at 6:10 PM, Scott Mead sco...@openscg.com wrote: On Sun, Jan 15, 2012 at 4:28 AM, Greg Smith g...@2ndquadrant.com

Re: [HACKERS] IDLE in transaction introspection

2012-01-16 Thread Scott Mead
On Sun, Jan 15, 2012 at 4:28 AM, Greg Smith g...@2ndquadrant.com wrote: On 01/12/2012 11:57 AM, Scott Mead wrote: Pretty delayed, but please find the attached patch that addresses all the issues discussed. The docs on this v4 look like they suffered a patch order problem here. In the v3,

Re: [HACKERS] IDLE in transaction introspection

2012-01-15 Thread Greg Smith
On 01/12/2012 11:57 AM, Scott Mead wrote: Pretty delayed, but please find the attached patch that addresses all the issues discussed. The docs on this v4 look like they suffered a patch order problem here. In the v3, you added a whole table describing the pg_stat_activity documentation in

Re: [HACKERS] IDLE in transaction introspection

2011-12-15 Thread Greg Smith
This patch seems closing in on being done, but it's surely going to take at least one more round of review to make sure all the naming and documentation is up right. I can work on that again whenever Scott gets another version necessary, and Magnus is already poking around with an eye toward

Re: [HACKERS] IDLE in transaction introspection

2011-12-15 Thread Magnus Hagander
On Thu, Dec 15, 2011 at 13:18, Greg Smith g...@2ndquadrant.com wrote: This patch seems closing in on being done, but it's surely going to take at least one more round of review to make sure all the naming and documentation is up right.  I can work on that again whenever Scott gets another

Re: [HACKERS] IDLE in transaction introspection

2011-12-15 Thread Scott Mead
On Thu, Dec 15, 2011 at 12:10 PM, Magnus Hagander mag...@hagander.netwrote: On Thu, Dec 15, 2011 at 13:18, Greg Smith g...@2ndquadrant.com wrote: This patch seems closing in on being done, but it's surely going to take at least one more round of review to make sure all the naming and

Re: [HACKERS] IDLE in transaction introspection

2011-12-12 Thread Magnus Hagander
On Wed, Dec 7, 2011 at 17:45, Scott Mead sco...@openscg.com wrote: On Tue, Dec 6, 2011 at 6:38 AM, Magnus Hagander mag...@hagander.net wrote: On Sat, Nov 19, 2011 at 02:55, Scott Mead sco...@openscg.com wrote: On Thu, Nov 17, 2011 at 11:58 AM, Scott Mead sco...@openscg.com wrote: On

Re: [HACKERS] IDLE in transaction introspection

2011-12-07 Thread Scott Mead
On Tue, Dec 6, 2011 at 6:38 AM, Magnus Hagander mag...@hagander.net wrote: On Sat, Nov 19, 2011 at 02:55, Scott Mead sco...@openscg.com wrote: On Thu, Nov 17, 2011 at 11:58 AM, Scott Mead sco...@openscg.com wrote: On Wed, Nov 16, 2011 at 4:09 PM, Scott Mead sco...@openscg.com wrote:

Re: [HACKERS] IDLE in transaction introspection

2011-12-06 Thread Magnus Hagander
On Sat, Nov 19, 2011 at 02:55, Scott Mead sco...@openscg.com wrote: On Thu, Nov 17, 2011 at 11:58 AM, Scott Mead sco...@openscg.com wrote: On Wed, Nov 16, 2011 at 4:09 PM, Scott Mead sco...@openscg.com wrote: On Tue, Nov 15, 2011 at 1:18 PM, Robert Treat r...@xzilla.net wrote: On Tue,

Re: [HACKERS] IDLE in transaction introspection

2011-11-17 Thread Scott Mead
On Wed, Nov 16, 2011 at 4:09 PM, Scott Mead sco...@openscg.com wrote: On Tue, Nov 15, 2011 at 1:18 PM, Robert Treat r...@xzilla.net wrote: On Tue, Nov 15, 2011 at 12:00 PM, Greg Smith g...@2ndquadrant.com wrote: On 11/15/2011 09:44 AM, Scott Mead wrote: Fell off the map last week,

Re: [HACKERS] IDLE in transaction introspection

2011-11-16 Thread Scott Mead
On Tue, Nov 15, 2011 at 1:18 PM, Robert Treat r...@xzilla.net wrote: On Tue, Nov 15, 2011 at 12:00 PM, Greg Smith g...@2ndquadrant.com wrote: On 11/15/2011 09:44 AM, Scott Mead wrote: Fell off the map last week, here's v2 that: * RUNNING = active * all states from CAPS to lower case

Re: [HACKERS] IDLE in transaction introspection

2011-11-15 Thread Scott Mead
On Thu, Nov 10, 2011 at 2:49 PM, Tom Lane t...@sss.pgh.pa.us wrote: Bruce Momjian br...@momjian.us writes: Well, we could use an optional details string for that. If not, we are still using the magic-string approach, which I thought we didn't like. No, we're not using magic strings,

Re: [HACKERS] IDLE in transaction introspection

2011-11-15 Thread Greg Smith
On 11/15/2011 09:44 AM, Scott Mead wrote: Fell off the map last week, here's v2 that: * RUNNING = active * all states from CAPS to lower case This looks like what I was hoping someone would add here now. Patch looks good, only issue I noticed was a spaces instead of a tab goof where you

Re: [HACKERS] IDLE in transaction introspection

2011-11-15 Thread Robert Treat
On Tue, Nov 15, 2011 at 12:00 PM, Greg Smith g...@2ndquadrant.com wrote: On 11/15/2011 09:44 AM, Scott Mead wrote: Fell off the map last week, here's v2 that:  * RUNNING = active  * all states from CAPS to lower case This looks like what I was hoping someone would add here now.  Patch

Re: [HACKERS] IDLE in transaction introspection

2011-11-10 Thread Scott Mead
On Nov 5, 2011 9:02 AM, Greg Smith g...@2ndquadrant.com wrote: On 11/04/2011 05:01 PM, Tom Lane wrote: Scott Meadsco...@openscg.com writes: I leave the waiting flag in place for posterity. With this in mind, is the consensus: RUNNING or ACTIVE Personally, I'd go for

Re: [HACKERS] IDLE in transaction introspection

2011-11-10 Thread Bruce Momjian
Scott Mead wrote: On Wed, Nov 2, 2011 at 4:12 AM, Albe Laurenz laurenz.a...@wien.gv.atwrote: Andrew Dunstan wrote: On 11/01/2011 09:52 AM, Tom Lane wrote: I'm for just redefining the query field as current or last query. +1 I could go either way on whether to rename it.

Re: [HACKERS] IDLE in transaction introspection

2011-11-10 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: It might be cleaner to use booleans: active: t/f in transaction: t/f I don't think so, because that makes some very strict assumptions that there are exactly four interesting states (an assumption that isn't even true today, to judge

Re: [HACKERS] IDLE in transaction introspection

2011-11-10 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian br...@momjian.us writes: It might be cleaner to use booleans: active: t/f in transaction: t/f I don't think so, because that makes some very strict assumptions that there are exactly four interesting states (an assumption that isn't even

Re: [HACKERS] IDLE in transaction introspection

2011-11-10 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Well, we could use an optional details string for that. If not, we are still using the magic-string approach, which I thought we didn't like. No, we're not using magic strings, we're using an enum --- maybe not an officially declared enum type, but it's

Re: [HACKERS] IDLE in transaction introspection

2011-11-05 Thread Greg Smith
On 11/04/2011 05:01 PM, Tom Lane wrote: Scott Meadsco...@openscg.com writes: I leave the waiting flag in place for posterity. With this in mind, is the consensus: RUNNING or ACTIVE Personally, I'd go for lower case. I was thinking it would be nice if this

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Magnus Hagander
On Fri, Nov 4, 2011 at 03:27, Fujii Masao masao.fu...@gmail.com wrote: On Thu, Nov 3, 2011 at 3:18 AM, Scott Mead sco...@openscg.com wrote: ISTM that we're all for:    creating a new column: state    renaming current_query = query    State will display RUNNING, IDLE, IDLE in transaction,

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Marti Raudsepp
On Wed, Nov 2, 2011 at 20:18, Scott Mead sco...@openscg.com wrote:    State will display RUNNING, IDLE, IDLE in transaction, etc... While we're already breaking everything, we could remove the waiting column and use a state with value 'waiting' instead. Also, returning these as text seems a

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Tom Lane
Marti Raudsepp ma...@juffo.org writes: While we're already breaking everything, we could remove the waiting column and use a state with value 'waiting' instead. -1 ... I think it's useful to see the underlying state as well as the waiting flag. Also, this would represent breakage of part of

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Magnus Hagander
On Fri, Nov 4, 2011 at 14:42, Tom Lane t...@sss.pgh.pa.us wrote: Marti Raudsepp ma...@juffo.org writes: While we're already breaking everything, we could remove the waiting column and use a state with value 'waiting' instead. -1 ... I think it's useful to see the underlying state as well as

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Robert Haas
On Fri, Nov 4, 2011 at 9:48 AM, Magnus Hagander mag...@hagander.net wrote: On Fri, Nov 4, 2011 at 14:42, Tom Lane t...@sss.pgh.pa.us wrote: Marti Raudsepp ma...@juffo.org writes: While we're already breaking everything, we could remove the waiting column and use a state with value 'waiting'

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Scott Mead
On Fri, Nov 4, 2011 at 9:48 AM, Magnus Hagander mag...@hagander.net wrote: On Fri, Nov 4, 2011 at 14:42, Tom Lane t...@sss.pgh.pa.us wrote: Marti Raudsepp ma...@juffo.org writes: While we're already breaking everything, we could remove the waiting column and use a state with value

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: I guess with the changes that showed different thing like fastpath, that makes sense. But if we just mapped the states that are there today straight off, is there any case where waiting can be true, when we're either idle or idle in transaction? I

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Robert Haas
On Fri, Nov 4, 2011 at 10:34 AM, Tom Lane t...@sss.pgh.pa.us wrote:  Robert's point about sinval catchup is another good one, though I don't remember what that does to the pg_stat_activity display. My thought was that sinval catchup might require acquiring a relation lock (e.g. on pg_class), and

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Marti Raudsepp
On Fri, Nov 4, 2011 at 15:42, Tom Lane t...@sss.pgh.pa.us wrote: Marti Raudsepp ma...@juffo.org writes: While we're already breaking everything, we could remove the waiting column and use a state with value 'waiting' instead. -1 ... I think it's useful to see the underlying state as well as

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Robert Haas
On Fri, Nov 4, 2011 at 12:46 PM, Marti Raudsepp ma...@juffo.org wrote: On Fri, Nov 4, 2011 at 15:42, Tom Lane t...@sss.pgh.pa.us wrote: Marti Raudsepp ma...@juffo.org writes: While we're already breaking everything, we could remove the waiting column and use a state with value 'waiting'

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Maybe there's a better term than running, like in progress or something of that sort. active? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Robert Haas
On Fri, Nov 4, 2011 at 2:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Maybe there's a better term than running, like in progress or something of that sort. active? +1. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Scott Mead
On Fri, Nov 4, 2011 at 2:31 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Nov 4, 2011 at 2:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Maybe there's a better term than running, like in progress or something of that sort. active? +1.

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Tom Lane
Scott Mead sco...@openscg.com writes: I leave the waiting flag in place for posterity. With this in mind, is the consensus: RUNNING or ACTIVE Personally, I'd go for lower case. regards, tom lane -- Sent via pgsql-hackers mailing list

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Robert Haas
On Fri, Nov 4, 2011 at 2:46 PM, Scott Mead sco...@openscg.com wrote:    If waiting == true, then state = WAITING    else      state = appropriate state No, I think the state and waiting columns should be completely independent. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Robert Treat
On Fri, Nov 4, 2011 at 3:28 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Nov 4, 2011 at 2:46 PM, Scott Mead sco...@openscg.com wrote:    If waiting == true, then state = WAITING    else      state = appropriate state No, I think the state and waiting columns should be completely

Re: [HACKERS] IDLE in transaction introspection

2011-11-04 Thread Robert Treat
On Fri, Nov 4, 2011 at 10:34 AM, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: I guess with the changes that showed different thing like fastpath, that makes sense. But if we just mapped the states that are there today straight off, is there any case where

Re: [HACKERS] IDLE in transaction introspection

2011-11-03 Thread Fujii Masao
On Thu, Nov 3, 2011 at 3:18 AM, Scott Mead sco...@openscg.com wrote: ISTM that we're all for:    creating a new column: state    renaming current_query = query    State will display RUNNING, IDLE, IDLE in transaction, etc...    query will display the last query that was executed. The

Re: [HACKERS] IDLE in transaction introspection

2011-11-02 Thread Albe Laurenz
Andrew Dunstan wrote: On 11/01/2011 09:52 AM, Tom Lane wrote: I'm for just redefining the query field as current or last query. +1 I could go either way on whether to rename it. Rename it please. current_query will just be wrong. I'd be inclined just to call it query or query_string

Re: [HACKERS] IDLE in transaction introspection

2011-11-02 Thread Scott Mead
On Wed, Nov 2, 2011 at 4:12 AM, Albe Laurenz laurenz.a...@wien.gv.atwrote: Andrew Dunstan wrote: On 11/01/2011 09:52 AM, Tom Lane wrote: I'm for just redefining the query field as current or last query. +1 I could go either way on whether to rename it. Rename it please.

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Magnus Hagander
On Tue, Nov 1, 2011 at 00:18, Scott Mead sco...@openscg.com wrote: On Mon, Oct 31, 2011 at 6:13 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column,

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Robert Haas
On Tue, Nov 1, 2011 at 7:38 AM, Magnus Hagander mag...@hagander.net wrote: If we are doing it, it might be useful to just call it query, so that it is dead obvious to people that the definition changed.. Yeah. Otherwise, people who are parsing the hard-coded strings idle and idle in

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Simon Riggs
On Mon, Oct 31, 2011 at 10:13 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column, that holds the idle/in transaction/running status, instead of the tools

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Magnus Hagander
On Tue, Nov 1, 2011 at 13:19, Simon Riggs si...@2ndquadrant.com wrote: On Mon, Oct 31, 2011 at 10:13 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column,

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Simon Riggs
On Tue, Nov 1, 2011 at 12:41 PM, Magnus Hagander mag...@hagander.net wrote: On Tue, Nov 1, 2011 at 13:19, Simon Riggs si...@2ndquadrant.com wrote: On Mon, Oct 31, 2011 at 10:13 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Robert Haas
On Tue, Nov 1, 2011 at 8:41 AM, Magnus Hagander mag...@hagander.net wrote: On Tue, Nov 1, 2011 at 13:19, Simon Riggs si...@2ndquadrant.com wrote: On Mon, Oct 31, 2011 at 10:13 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: Why not leave it exactly as it is, and add a previous_query column? That gives you exactly what you need without breaking anything. That would cost twice as much shared memory for query strings, and twice as much time to update the strings, for what

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Simon Riggs
On Tue, Nov 1, 2011 at 1:52 PM, Tom Lane t...@sss.pgh.pa.us wrote: Simon Riggs si...@2ndquadrant.com writes: Why not leave it exactly as it is, and add a previous_query column? That gives you exactly what you need without breaking anything. That would cost twice as much shared memory for

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Robert Haas
On Tue, Nov 1, 2011 at 9:52 AM, Tom Lane t...@sss.pgh.pa.us wrote: Simon Riggs si...@2ndquadrant.com writes: Why not leave it exactly as it is, and add a previous_query column? That gives you exactly what you need without breaking anything. That would cost twice as much shared memory for

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Marti Raudsepp
On Mon, Oct 31, 2011 at 23:37, Scott Mead sco...@openscg.com wrote:    So I wrote the attached patch, it just turns IDLE in transaction into:  IDLE in transaction\n: Previous: last query executed.  After seeing how quickly our dev's fixed the issue once they saw prepared statement XYZ, Solving

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Jeroen Vermeulen
On 2011-11-01 21:13, Andrew Dunstan wrote: Rename it please. current_query will just be wrong. I'd be inclined just to call it query or query_string and leave it to the docs to define the exact semantics. I think query for a query that isn't ongoing would be just as wrong. How about

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Tue, Nov 1, 2011 at 9:52 AM, Tom Lane t...@sss.pgh.pa.us wrote: That would cost twice as much shared memory for query strings, and twice as much time to update the strings, for what seems pretty marginal value.  I'm for just redefining the query

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Cédric Villemain
2011/11/1 Marti Raudsepp ma...@juffo.org: On Mon, Oct 31, 2011 at 23:37, Scott Mead sco...@openscg.com wrote:    So I wrote the attached patch, it just turns IDLE in transaction into:  IDLE in transaction\n: Previous: last query executed.  After seeing how quickly our dev's fixed the issue

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Magnus Hagander
On Tue, Nov 1, 2011 at 18:11, Scott Mead sco...@openscg.com wrote: On Tue, Nov 1, 2011 at 10:40 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, Nov 1, 2011 at 9:52 AM, Tom Lane t...@sss.pgh.pa.us wrote: That would cost twice as much shared memory

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Scott Mead
On Tue, Nov 1, 2011 at 1:20 PM, Magnus Hagander mag...@hagander.net wrote: On Tue, Nov 1, 2011 at 18:11, Scott Mead sco...@openscg.com wrote: On Tue, Nov 1, 2011 at 10:40 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, Nov 1, 2011 at 9:52 AM,

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Magnus Hagander
On Tue, Nov 1, 2011 at 18:40, Scott Mead sco...@openscg.com wrote: On Tue, Nov 1, 2011 at 1:20 PM, Magnus Hagander mag...@hagander.net wrote: On Tue, Nov 1, 2011 at 18:11, Scott Mead sco...@openscg.com wrote: On Tue, Nov 1, 2011 at 10:40 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Robert Treat
On Tue, Nov 1, 2011 at 1:20 PM, Magnus Hagander mag...@hagander.net wrote: On Tue, Nov 1, 2011 at 18:11, Scott Mead sco...@openscg.com wrote: On Tue, Nov 1, 2011 at 10:40 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, Nov 1, 2011 at 9:52 AM, Tom

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Andrew Dunstan
On 11/01/2011 09:52 AM, Tom Lane wrote: Simon Riggssi...@2ndquadrant.com writes: Why not leave it exactly as it is, and add a previous_query column? That gives you exactly what you need without breaking anything. That would cost twice as much shared memory for query strings, and twice as

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Scott Mead
On Tue, Nov 1, 2011 at 10:40 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, Nov 1, 2011 at 9:52 AM, Tom Lane t...@sss.pgh.pa.us wrote: That would cost twice as much shared memory for query strings, and twice as much time to update the strings, for

Re: [HACKERS] IDLE in transaction introspection

2011-11-01 Thread Ross J. Reedstrom
On Tue, Nov 01, 2011 at 10:13:52AM -0400, Andrew Dunstan wrote: On 11/01/2011 09:52 AM, Tom Lane wrote: Simon Riggssi...@2ndquadrant.com writes: Why not leave it exactly as it is, and add a previous_query column? That gives you exactly what you need without breaking anything. That would

[HACKERS] IDLE in transaction introspection

2011-10-31 Thread Scott Mead
Hey all, So, I'm dealing with a a big ol' java app that has multiple roads on the way to IDLE in transaction. We can reproduce the problem in a test environment, but the lead dev always asks can you just tell me the last query that it ran? So I wrote the attached patch, it just turns IDLE

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Magnus Hagander
On Mon, Oct 31, 2011 at 22:37, Scott Mead sco...@openscg.com wrote: Hey all,    So, I'm dealing with a a big ol' java app that has multiple roads on the way to IDLE in transaction.  We can reproduce the problem in a test environment, but the lead dev always asks can you just tell me the last

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Jaime Casanova
On Mon, Oct 31, 2011 at 4:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column, that holds the idle/in transaction/running status, instead of the tools having to parse the query text to get that information... if we are going

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Robert Haas
On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column, that holds the idle/in transaction/running status, instead of the tools having to parse the query text to get that information... +1 for doing it

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Scott Mead
On Mon, Oct 31, 2011 at 6:13 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column, that holds the idle/in transaction/running status, instead of the

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Scott Mead
On Mon, Oct 31, 2011 at 7:18 PM, Scott Mead sco...@openscg.com wrote: On Mon, Oct 31, 2011 at 6:13 PM, Robert Haas robertmh...@gmail.comwrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column,