Re: A patch for get origin from commit_ts.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "movead(dot)li(at)highgo(dot)ca" <movead(dot)li(at)highgo(dot)ca>
Cc: petr <petr(at)2ndquadrant(dot)com>, simon <simon(at)2ndquadrant(dot)com>, "Madan Kumar" <madankumar1993(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, craig <craig(at)2ndquadrant(dot)com>, "Alvaro Herrera" <alvherre(at)2ndquadrant(dot)com>, andres <andres(at)anarazel(dot)de>, soumyadeep2007 <soumyadeep2007(at)gmail(dot)com>
Subject: Re: A patch for get origin from commit_ts.
Date: 2020-07-06 08:01:36
Message-ID: 20200706080136.GH2143@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 06, 2020 at 11:12:30AM +0800, movead(dot)li(at)highgo(dot)ca wrote:
> Thanks for the points and follow them, new patch attached.

That was fast, thanks. I have not tested the patch, but there are
two things I missed a couple of hours back. Why do you need
pg_last_committed_xact_with_origin() to begin with? Wouldn't it be
more simple to just add a new column to pg_last_committed_xact() for
the replication origin? Contrary to pg_xact_commit_timestamp() that
should not be broken for compatibility reasons because it returns only
one value, we don't have this problem with pg_last_committed_xact() as
it already returns one tuple with two values.

+{ oid => '4179', descr => 'get commit origin of a transaction',

A second thing is that the OID of the new function should be in the
range 8000..9999, as per the policy introduced in commit a6417078.
src/include/catalog/unused_oids can be used to pick up a value.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2020-07-06 08:17:07 Re: proposal: schema variables
Previous Message Georgios 2020-07-06 07:54:12 Re: Include access method in listTables output