Rational Datatype

34 views
Skip to first unread message

Mike Goodwin

unread,
Jan 23, 2025, 3:52:20 PMJan 23
to h2-da...@googlegroups.com
I have added support for a rational datatype (i.e. an arbitrary precision fraction) to the database.

Is there any appetite for integrating this into h2?

regards,

Mike

Evgenij Ryazanov

unread,
Jan 23, 2025, 7:49:52 PMJan 23
to H2 Database
Hello!

There is no such thing in SQL and usually fractions are stored in a couple of numeric fields, or in a UDT. UDTs aren't supported by H2, but you can use a row value data type value like ROW(NUMERATOR BIGINT, DENOMINATOR BIGINT) and define your functions with CREATE ALIAS in your application directly, if you have a use case for it.

Introduction of built-in exotic non-standard data type is not a good idea at all, especially when everyone who uses it wants to have some own storage format based on different numeric data types.
Reply all
Reply to author
Forward
0 new messages