A patch for get origin from commit_ts.
movead.li@highgo.ca <movead.li@highgo.ca>
From: "movead.li@highgo.ca" <movead.li@highgo.ca>
To: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-05-11T08:43:11Z
Lists: pgsql-hackers
Attachments
- get_origin_from_commit_ts.patch (application/octet-stream) patch
Hello hackers,
I am researching about 'origin' in PostgreSQL, mainly it used in logical
decoding to filter transaction from non-local source. I notice that the
'origin' is stored in commit_ts so that I think we are possible to get 'origin'
of a transaction from commit_ts.
But I can not fond any code to get 'origin' from commit_ts, just like it is
producing data which nobody cares about. Can I know what's the purpose
of the 'origin' in commit_ts? Do you think we should add some support
to the careless data?
For example, I add a function to get 'origin' from commit_ts:
=======================================
postgres=# select pg_xact_commit_origin('490');
pg_xact_commit_origin
-----------------------
test_origin
(1 row)
postgres=# select pg_xact_commit_origin('491');
pg_xact_commit_origin
-----------------------
test_origin1
(1 row)
postgres=#
=======================================
Regards,
Highgo Software (Canada/China/Pakistan)
URL : www.highgo.ca
EMAIL: mailto:movead(dot)li(at)highgo(dot)ca
Commits
-
Include replication origins in SQL functions for commit timestamp
- b1e48bbe64a4 14.0 landed
-
Create a script that can renumber manually-assigned OIDs.
- a6417078c414 12.0 cited