PostgreSQL High Precision Support Extension.

Поиск
Список
Период
Сортировка
От A Z
Тема PostgreSQL High Precision Support Extension.
Дата
Msg-id PSXP216MB0085ADE313F9F48A134057F39AA19@PSXP216MB0085.KORP216.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответы Re: PostgreSQL High Precision Support Extension.  (Thomas Munro <thomas.munro@gmail.com>)
Re: PostgreSQL High Precision Support Extension.  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
I have been trying to get a reply or interest in either updating PostgreSQL to support the following,
or for there to be a public, free for any use Extension put out there, that will support the following.
Can someone able and interested please respond to me about the following project specification,
which I am very keen to see happen:

###################################################
# High Precision Numeric and Elementary Functions Support. #
###################################################

-Integer (HPZ) Z, or Rational Decimal Q (HPQ) numbers support.

-A library like GMP, written in C, is an appropriate basis to start from and to include, for all OS platforms involved.

-Real numbers include the values of both Recurring Rational Numbers and recurring Irrational Numbers.  Those two can be appropriately truncated, by a precision value, to obtain an approximating value.  The latter phenomenon is a finite Rational value, possibly with integer and/or decimal parts at the same time.  These also may be positive or negative, or zero, standard number line, values.

-Forward and Inverse operations accuracy, withstanding truncation, can be maintained by storing and normalising the expression behind a value, (or by just including pointers to value(s)) and displaying that value. This system will uphold any precision, certainly within a very large range limit.

-A defaulting number of significant figures, (precision), in a field in memory that exists as one copy per connection,  that is updated, as a filter, for all relevant HPZ and HPQ numbers. For example, 20 significant figures, as a default, would be sensible to start with.

-A function that varies the precision filter for every HPZ and HPQ number at once.

-Value assignment to a typed variable by =.

-Operators.  Base 10 Arithmetic and comparisons support on Base 10 Integer and Rational Decimal numbers, and casting:

+,-,*,/,%,^,=,!=,<>,>,<,>=,<=, ::

These include full finite division and integer only division, with no remainder, and remainder division. The defaulting ability of values within the two new types to automatically be cast up to HPZ or HPQ, where specified and appropriate in PostgreSQL code.

-Reified support with broader syntax and operations within PostgreSQL, in all the obvious and less than obvious places.  Tables and related phenomena, HPZ arrays, Indexing, the Window type, Record type, direct compatability with Aggregate and Window Functions, the Recursive keyword, are all parts of a larger subset that should re-interact with HPZ or HPQ.

-Ease of installation support. Particularly for Windows and Linux. *.exe, *.msi or *.rpm, *.deb, *.bin installers.
Upon a PostgreSQL standard installation.  Installation and Activation instructions included.  That is, presuming the HPZ and HPQ support is an Extension, and simply not added as native, default types into PostgreSQL Baseline.

##############################################################

-Mathematical and Operational functions support:

precision(BIGINT input)

cast(HPZ as HPQ) returns HPQ;
cast(HPQ as HPZ) returns HPZ;
cast(TEXT as HPZ) returns HPZ;
cast(TEXT as HPQ) returns HPQ;
cast(HPQ as TEXT) returns TEXT;
cast(HPZ as TEXT) returns TEXT;
cast(HPZ as SMALLINT) returns SMALLINT;
cast(SMALLINT as HPQ) returns HPZ;
cast(HPZ as INTEGER) returns INTEGER;
cast(INTEGER as HPZ) returns HPZ;
cast(HPZ as BIGINT) returns BIGINT;
cast(BIGINT as HPZ) returns HPZ;
cast(HPQ as REAL) returns REAL;
cast(REAL as HPQ) returns HPQ
cast(DOUBLE PRECISION as HPQ) returns HPQ;
cast(HPQ as DOUBLE PRECISION) returns DOUBLE PRECISION;
cast(HPQ as DECIMAL) returns DECIMAL;
cast(DECIMAL as HPQ) returns HPQ;
cast(HPQ as NUMERIC) returns NUMERIC;
cast(NUMERIC as HPQ) returns HPQ;

sign(HPQ input) returns HPQ;
abs(HPQ input) returns HPQ;
ceil(HPQ input) returns HPQ;
floor(HPQ input) returns HPQ;
round(HPQ input) returns HPZ;
recip(HPQ input) returns HPQ;
pi() returns HPQ;
e() returns HPQ;
power(HPQ base, HPQ exponent) returns HPQ;
sqrt(HPQ input) returns HPQ
nroot(HPZ theroot, HPQ input) returns HPQ;
log10(HPQ input) returns HPQ;
loge(HPQ input) returns HPQ;
log2(HPQ input) returns HPQ;
factorial(HPZ input) returns HPZ;
nCr(HPZ objects, HPZ selectionSize) returns HPZ
nPr(HPZ objects, HPZ selectionSize) returns HPZ

degrees(HPQ input) returns HPQ;
radians(HPQ input) returns HPQ;
sind(HPQ input) returns HPQ;
cosd(HPQ input) returns HPQ;
tand(HPQ input) returns HPQ;
asind(HPQ input) returns HPQ;
acosd(HPQ input) returns HPQ;
atand(HPQ input) returns HPQ;
sinr(HPQ input) returns HPQ;
cosr(HPQ input) returns HPQ;
tanr(HPQ input) returns HPQ;
asinr(HPQ input) returns HPQ;
acosr(HPQ input) returns HPQ;
atanr(HPQ input) returns HPQ;

##############################################################

-Informative articles on all these things exist at:
Comparison Operators: https://en.wikipedia.org/wiki/Relational_operator
Floor and Ceiling Functions: https://en.wikipedia.org/wiki/Floor_and_ceiling_functions
Arithmetic Operations: https://en.wikipedia.org/wiki/Arithmetic
Integer Division: https://en.wikipedia.org/wiki/Division_(mathematics)#Of_integers
Modulus Operation: https://en.wikipedia.org/wiki/Modulo_operation
Rounding (Commercial Rounding): https://en.wikipedia.org/wiki/Rounding
Factorial Operation: https://en.wikipedia.org/wiki/Factorial
Degrees: https://en.wikipedia.org/wiki/Degree_(angle)
Radians: https://en.wikipedia.org/wiki/Radian
Elementary Functions: https://en.wikipedia.org/wiki/Elementary_function

The following chart could be used to help test trigonometry outputs, under
Further Condsideration of the Unit Circle:
https://courses.lumenlearning.com/boundless-algebra/chapter/trigonometric-functions-and-the-unit-circle/
##############################################################

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: mem context is not reset between extended stats
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: mem context is not reset between extended stats