Skip to content

fix: oid is u32, not i32 #873

Merged
levkk merged 2 commits intomainfrom
levkk-implement-oid-fix
Apr 7, 2026
Merged

fix: oid is u32, not i32 #873
levkk merged 2 commits intomainfrom
levkk-implement-oid-fix

Conversation

@levkk
Copy link
Copy Markdown
Collaborator

@levkk levkk commented Apr 7, 2026

Possibly fixes #847.

We incorrectly implemented oid as i32, but it's actually u32, so OIDs over 2.2B would be read as 0. On very busy databases that constantly create/destroy tables/columns, this would overflow. OIDs are not guaranteed to be unique and it gets pretty bad when the oid search space gets small (i.e. very large tables), but we still want to support large OIDs since they are valid.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 90.85366% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog-postgres-types/src/oid.rs 84.21% 12 Missing ⚠️
pgdog/src/backend/replication/buffer.rs 0.00% 1 Missing ⚠️
...g/src/net/messages/replication/logical/truncate.rs 0.00% 1 Missing ⚠️
...dog/src/net/messages/replication/logical/update.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@levkk levkk merged commit 70d4839 into main Apr 7, 2026
10 checks passed
@levkk levkk deleted the levkk-implement-oid-fix branch April 7, 2026 05:15
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

Successfully merging this pull request may close these issues.

[resharding] ERROR: XX000 could not open relation with OID 0

1 participant