Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Hot Standby utility and administrator functions

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Zeugswetter Andreas OSB sIT <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "pgadmin-hackers(at)postgresql(dot)org" <pgadmin-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [HACKERS] Hot Standby utility and administrator functions
Date: 2008-10-21 14:15:12
Message-ID: 1224598512.27145.94.camel@ebony.2ndQuadrant (view raw, whole thread or download thread mbox)
Lists: pgadmin-hackerspgsql-generalpgsql-hackers
On Tue, 2008-10-21 at 09:44 +0200, Zeugswetter Andreas OSB sIT wrote:
> > > * pg_last_recovered_xact_xid()
> > > Will throw an ERROR if *not* executed in recovery mode.
> > > returns bigint
> > >
> > > * pg_last_completed_xact_xid()
> > > Will throw an ERROR *if* executed in recovery mode.
> > > returns bigint
> >
> > Should these return xid?
> And shouldn't these two be folded together ?
> It seems most usages of this xid(/lsn?) will be agnostic to the
> recovery mode. Or if not, it seems more convenient to have a function
> that returns both recovery mode and xid, no ?

You are right that it would be better to have a single function.
Functions that return multiple values are a pain to use and develop,
plus we can always run the other function if we are in doubt.

txid_last_completed() returns bigint (txid) seems better.

I am more than happy to add an id version as well, if anybody sees the
need for that. Just say.

 Simon Riggs 
 PostgreSQL Training, Services and Support

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-10-21 14:25:50
Subject: Re: automatic parser generation for ecpg
Previous:From: Andrew DunstanDate: 2008-10-21 14:11:41
Subject: Re: minimal update

pgadmin-hackers by date

Next:From: Gevik BabakhaniDate: 2008-10-22 08:15:01
Subject: website down?
Previous:From: Tom LaneDate: 2008-10-21 12:10:00
Subject: Re: [HACKERS] Hot Standby utility and administrator functions

pgsql-general by date

Next:From: Craig RingerDate: 2008-10-21 14:21:34
Subject: Re: Where are updates from inside transactions visible?
Previous:From: Sergey KonoplevDate: 2008-10-21 14:13:25
Subject: Re: index scan leads to result that is different from sec scan after upgrading to 8.3.4

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group