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

2012-05-09 Thread Simon Riggs
On 9 May 2012 15:34, Tom Lane wrote: > Simon Riggs 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, i

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

2012-05-09 Thread Tom Lane
Simon Riggs 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 guarantee that age's

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

2012-05-09 Thread Simon Riggs
On 9 May 2012 00:55, Simon Riggs wrote: > On 8 May 2012 20:01, Peter Eisentraut 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)) >>>       { >>>      

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

2012-05-08 Thread Simon Riggs
On 8 May 2012 20:01, Peter Eisentraut 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 = GetTopTransactionIdIf

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 (!TransactionIdIsValid(age

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

2012-01-18 Thread Tom Lane
Simon Riggs 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 right thing for the

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

2012-01-18 Thread Simon Riggs
On Wed, Jan 18, 2012 at 7:55 PM, Tom Lane wrote: > Peter Eisentraut 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. >

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

2012-01-18 Thread Tom Lane
Peter Eisentraut 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 should work abo

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 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

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 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 make

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

2012-01-16 Thread Tom Lane
Alvaro Herrera 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 declared to be. >> Co

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 writes: > > > Excerpts from Peter Eisentraut's message of mié dic 28 15:04:09 -0300 > > > 2011: > > >> On a hot standby, this fails with: > > >>

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 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_ag

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

2011-12-28 Thread Tom Lane
Alvaro Herrera 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 if that returns Inv

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: c

[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 u