Re: Hot Standby utility and administrator functions - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Hot Standby utility and administrator functions
Date
Msg-id 1224598512.27145.94.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: Hot Standby utility and administrator functions  (Zeugswetter Andreas OSB sIT <Andreas.Zeugswetter@s-itsolutions.at>)
List pgsql-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           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: minimal update
Next
From: Tom Lane
Date:
Subject: Re: automatic parser generation for ecpg