Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on oldkeys #187

Open
mijoharas opened this issue Nov 25, 2020 · 2 comments
Open

Documentation on oldkeys #187

mijoharas opened this issue Nov 25, 2020 · 2 comments

Comments

@mijoharas
Copy link
Contributor

mijoharas commented Nov 25, 2020

Hey, Happy to provide a PR, just want to check it's wanted.

I couldn't find any description of what "oldkeys" was. Now I traced the code, and my understanding is that it's a description of the replica identity for the tuple that's the subject of the action (for updates and deletes). The replica identity should be the primary key in most cases (it gets slightly weird if pkeys change, which is why you have the pointer to the old tuple for that weird edge case).

This all makes sense, but can we document that that's what this means?

Let me know if you'd like this and if I have understood correctly and I'll happily raise a PR to add it to the readme.

(also, there's at least one place online that seems to use this plugin and have a different explanation of what this data means.)

@eulerto
Copy link
Owner

eulerto commented Nov 25, 2020

I tried to explain when old tuple is available here. Maybe it would be a good idea to clarify this behavior in the README. If I were to write this explanation, I would add a new section that explains what a replica identity is and provide details about each change (INSERT, UPDATE, DELETE) when you use different replica identity. I would also add a paragraph that explain the unchanged TOAST columns.

Feel free to submit a PR.

@mijoharas
Copy link
Contributor Author

I found that link useful to help understand what was going on in the code, that only told me when the oldtuple was available, but not really what oldkeys meant in the general case, (I wanted to be absolutely sure that it was always the replica identity, and had to trace more of the code than I'd care to admit to figure that out, I'm sure it's mostly just my unfamiliarity with this library).

I'll write the PR, but I'm not actually aware of the unchanged TOAST column stuff (I saw a couple of bools about that in the code, but I didn't actually follow them), so would appreciate a hand with that bit? in the meantime I'll put a small stub with a TODO for that.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants