Re: [HACKERS] age(xid) on hot standby

2012-05-09 Thread Simon Riggs
On 9 May 2012 00:55, Simon Riggs si...@2ndquadrant.com wrote: On 8 May 2012 20:01, Peter Eisentraut pete...@gmx.net wrote: On ons, 2012-01-18 at 14:55 -0500, Tom Lane wrote: BTW, it strikes me that maybe the coding should work about like this:       if

Re: [HACKERS] age(xid) on hot standby

2012-05-09 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: We should just use MyPgXact-xid rather than add more to the transaction path I'll simplify the patch and commit. Committed, but forgot to give appropriate credit. Sorry about that. This patch didn't fix things, it broke things. The former

Re: [HACKERS] age(xid) on hot standby

2012-05-09 Thread Simon Riggs
On 9 May 2012 15:34, Tom Lane t...@sss.pgh.pa.us wrote: Simon Riggs si...@2ndquadrant.com writes: We should just use MyPgXact-xid rather than add more to the transaction path I'll simplify the patch and commit. Committed, but forgot to give appropriate credit. Sorry about that. This patch

Re: [HACKERS] age(xid) on hot standby

2012-05-08 Thread Peter Eisentraut
On ons, 2012-01-18 at 14:55 -0500, Tom Lane wrote: BTW, it strikes me that maybe the coding should work about like this: if (!TransactionIdIsValid(age_reference_xid)) { age_reference_xid = GetTopTransactionIdIfAny(); if

Re: [HACKERS] age(xid) on hot standby

2012-05-08 Thread Simon Riggs
On 8 May 2012 20:01, Peter Eisentraut pete...@gmx.net wrote: On ons, 2012-01-18 at 14:55 -0500, Tom Lane wrote: BTW, it strikes me that maybe the coding should work about like this:       if (!TransactionIdIsValid(age_reference_xid))       {               age_reference_xid =

Re: [HACKERS] age(xid) on hot standby

2012-01-18 Thread Peter Eisentraut
On mån, 2012-01-16 at 22:59 -0300, Alvaro Herrera wrote: Excerpts from Tom Lane's message of lun ene 16 12:27:03 -0300 2012: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Peter Eisentraut's message of dom ene 15 10:00:03 -0300 2012: On ons, 2011-12-28 at 14:35

Re: [HACKERS] age(xid) on hot standby

2012-01-18 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On mån, 2012-01-16 at 22:59 -0300, Alvaro Herrera wrote: So who's going to work on a patch? Peter, are you? If not, we should add it to the TODO list. Not at this very moment, but maybe in a few weeks. BTW, it strikes me that maybe the coding

Re: [HACKERS] age(xid) on hot standby

2012-01-18 Thread Simon Riggs
On Wed, Jan 18, 2012 at 7:55 PM, Tom Lane t...@sss.pgh.pa.us wrote: Peter Eisentraut pete...@gmx.net writes: On mån, 2012-01-16 at 22:59 -0300, Alvaro Herrera wrote: So who's going to work on a patch?  Peter, are you?  If not, we should add it to the TODO list. Not at this very moment, but

Re: [HACKERS] age(xid) on hot standby

2012-01-18 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: I think we should apply the patch to return the correct SQLCODE in all cases, even if its supposedly not possible. [ shrug... ] My opinion about that has not changed. Those are internal sanity checks, and as such, ERRCODE_INTERNAL_ERROR is exactly the

Re: [HACKERS] age(xid) on hot standby

2012-01-16 Thread Alvaro Herrera
Excerpts from Peter Eisentraut's message of dom ene 15 10:00:03 -0300 2012: On ons, 2011-12-28 at 14:35 -0500, Tom Lane wrote: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Peter Eisentraut's message of mié dic 28 15:04:09 -0300 2011: On a hot standby, this fails

Re: [HACKERS] age(xid) on hot standby

2012-01-16 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Peter Eisentraut's message of dom ene 15 10:00:03 -0300 2012: On ons, 2011-12-28 at 14:35 -0500, Tom Lane wrote: The trouble with using ReadNewTransactionId is that it makes the results volatile, not stable as the function is

Re: [HACKERS] age(xid) on hot standby

2012-01-16 Thread Alvaro Herrera
Excerpts from Tom Lane's message of lun ene 16 12:27:03 -0300 2012: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Peter Eisentraut's message of dom ene 15 10:00:03 -0300 2012: On ons, 2011-12-28 at 14:35 -0500, Tom Lane wrote: The trouble with using ReadNewTransactionId

Re: [HACKERS] age(xid) on hot standby

2012-01-15 Thread Peter Eisentraut
On ons, 2011-12-28 at 14:35 -0500, Tom Lane wrote: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Peter Eisentraut's message of mié dic 28 15:04:09 -0300 2011: On a hot standby, this fails with: ERROR: cannot assign TransactionIds during recovery I think we could just

[HACKERS] age(xid) on hot standby

2011-12-28 Thread Peter Eisentraut
The check_postgres txn_wraparound action[0] runs this query: SELECT datname, age(datfrozenxid) AS age FROM pg_database WHERE datallowconn ORDER BY 1, 2 On a hot standby, this fails with: ERROR: cannot assign TransactionIds during recovery So, a couple of things to wonder about: Is it

Re: [HACKERS] age(xid) on hot standby

2011-12-28 Thread Alvaro Herrera
Excerpts from Peter Eisentraut's message of mié dic 28 15:04:09 -0300 2011: The check_postgres txn_wraparound action[0] runs this query: SELECT datname, age(datfrozenxid) AS age FROM pg_database WHERE datallowconn ORDER BY 1, 2 On a hot standby, this fails with: ERROR: cannot

Re: [HACKERS] age(xid) on hot standby

2011-12-28 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Peter Eisentraut's message of mié dic 28 15:04:09 -0300 2011: On a hot standby, this fails with: ERROR: cannot assign TransactionIds during recovery I think we could just have the xid_age call GetCurrentTransactionIdIfAny, and