Closed JaoodxD closed 1 year ago
Thanks for the update, Maksym!
Two other questions:
Thanks for the update, Maksym!
Two other questions:
- Did you run through the other examples in the README as well?
Yes, everything else works fine.
- Can you also check whether the test suite passes on your version of Postgres?
Just passed through test cases.
Here is the output.
pg_rational_test.txt
If it's necessary my current version of PG is 14.6
As I'm thinking about this again, I realize that going through float is an inefficient route.
What we should be doing is using the rational_embed()
code path: https://github.com/begriffs/pg_rational/blob/master/pg_rational.c#L217
Ideally put it behind a new rational_in_bigint()
function that tests that the bigint is actually within range for the numerator like this: https://github.com/begriffs/pg_rational/blob/master/pg_rational.c#L87-L90
Then add a new cast for bigint, similar to the one for float: https://github.com/begriffs/pg_rational/blob/master/pg_rational--0.0.2.sql#L56-L58
Is this something you feel you have the energy to contribute?
Nevermind, I found a simpler approach: cast nextval through integer and mark the sequence as integer type.
Fix example of using rational sequence. Not working without explicitly casting
bigint
torational
.