Skip to content

Oid is unsigned #26

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

Closed
jeff-davis opened this issue Jan 2, 2014 · 4 comments
Closed

Oid is unsigned #26

jeff-davis opened this issue Jan 2, 2014 · 4 comments
Labels

Comments

@jeff-davis
Copy link
Contributor

I could submit a one-character patch if needed ;-)

@sfackler
Copy link
Owner

sfackler commented Jan 2, 2014

The message protocol docs seem to imply that it's signed, though they may just be playing it a bit fast and loose with the definition of "Int32": http://www.postgresql.org/docs/9.3/static/protocol-message-formats.html under ParameterDescription or RowDescription and http://www.postgresql.org/docs/9.3/static/protocol-message-types.html

@jeff-davis
Copy link
Contributor Author

The backend uses unsigned integers for Oid; there's a pretty clear typedef. And it reads into that unsigned type in getParamDescriptions.

I don't have a good explanation for the docs. I sent a mail to the lists here:

http://www.postgresql.org/message-id/1388686291.19125.437.camel@jdavis

But in the meantime, an Oid type is certainly unsigned in the server and at the SQL level:

select 4000000000::oid

works.

@sfackler
Copy link
Owner

sfackler commented Jan 2, 2014

Interesting. There are probably some other parts of the message protocol that should be unsigned as well.

@jeff-davis
Copy link
Contributor Author

http://www.postgresql.org/message-id/[email protected]

Confirmed -- more of a doc issue. I will probably try to make a doc patch.

Rust-postgres should be using a u32 for Oid though.

pimeys pushed a commit to grafbase/rust-postgres that referenced this issue Nov 27, 2023
Added getter for process_id
pimeys pushed a commit to grafbase/rust-postgres that referenced this issue Nov 27, 2023
Added getter for process_id
petrosagg added a commit to petrosagg/rust-postgres that referenced this issue Apr 9, 2025
buffer 16 messages in copy-both involved channels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants