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

Pass 64-bit types by reference on 32-bit platforms #1685

Open
CoderPuppy opened this issue Apr 29, 2024 · 1 comment
Open

Pass 64-bit types by reference on 32-bit platforms #1685

CoderPuppy opened this issue Apr 29, 2024 · 1 comment

Comments

@CoderPuppy
Copy link

Int64, UInt64 and Float8 are all passed by reference when the pointer size is less than 64 bit. In Postgres this is controlled by the USE_FLOAT8_BYVAL macro defined in pg_config_manual.h, which is used when defining DatumGetInt64/UIn64/Float8 and Int64/UInt64/Float8GetDatum in postgres.h (and propagated to FLOAT8PASSBYVAL). The same logic should be implemented in IntoDatum and FromDatum for i64, u64 and f64.

@workingjubilee
Copy link
Member

workingjubilee commented Apr 30, 2024

It is documented in the system requirements that we do not support 32-bit systems.

While it mentions some examples, these are not the only cases that assume a 64-bit Datum type. Making pgrx work on 32-bit very well requires more than these changes, and it requires pervasive changes, because we e.g. provide a pg_sys::Datum::from(i64). That cannot work except by truncating data on a 32-bit system.

While we have merged changes that make it a little easier to run pgrx on a 32-bit system before, this is the point where things become more than incidentally adding support. I really want to know why we'd be adding support. Finishing 32-bit support is going to cost hundreds of lines of code of revision and review.

And I'd want real tests, here, that I can run while on a 64-bit system, because otherwise I'm going to break it again. With a test suite that is a command away, I at least can lean on those.

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 a pull request may close this issue.

2 participants