Question about creation of a new PostgreSQL Extension.
To who it may concern, I am trying to get a project completed to enhance PostgreSQL arithmetic and elementary functions prowess by means of two new High Precision mixed decimal number types in a self installing extension. Hopefully, I want this to be a free or low cost project. Is there anyone who can read these project specifications and email back to me here, at powerus...@live.com.au, to give me a quote for this project? They are in my top posting at this discussion thread, at: https://github.com/dvarrazzo/pgmp/issues/22 The extension could be called HPPM, High Precision Postgresql Mathematics. It is to be written in C, and will need a number of offline installers for major operating systems, like Windows 10/11 or rpm based Linux. The project could be hosted on SourceForge or GitHub. If anyone on this list is interested, or knows which direction to point me in, could they please reply to me here, at powerus...@live.com.au? ZM.
Question about an Extension Project
To who it may concern, I am trying to get a project completed to enhance PostgreSQL arithmetic and elementary functions prowess by means of two new High Precision mixed decimal number types in a self installing extension. Hopefully, I want this to be a free or low cost project. Is there anyone who can read these project specifications and email back to me here, at powerus...@live.com.au, to give me a quote for this project? They are in my top posting at this discussion thread, at: https://github.com/dvarrazzo/pgmp/issues/22 The extension could be called HPPM, High Precision Postgresql Mathematics. It is to be written in C, and will need a number of offline installers for major operating systems, like Windows 10/11 or rpm based Linux. The project could be hosted on SourceForge or GitHub. If anyone on this list is interested, or knows which direction to point me in, could they please reply to me here, at powerus...@live.com.au? ZM.
Improved PostgreSQL Mathematics Support.
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: # High Precision Numeric and Elementary Functions Support. # -Integer (HPZ) Z, or Rational Decimal Q (HPQ) numbers support. -Recurring Rational Numbers and recurring Irrational Numbers 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 may be positive or negative, standard number line, values. -Forward and Inverse operations accuracy, withstanding truncation, can be maintained by storing and normalising the expression behind a value, (or just include pointers to the value) and displaying the evaluation. This system will uphold any precision. -A defaulting number of significant figures (precision), in one copy of one field in memory that is held in there, as a filter, for all HPZ and HPQ numbers. For example, 20 significant figures, as a default, to start by. -A function that varies the precision filter for every HPZ and HPQ number at once. -Value assignment to a typed variable by =. -Base 10 Arithmetic and comparisons support on Base 10 Integer and Rational Decimal numbers. +,-,*,/,%,^,=,!=,<>,>,<,>=,<=, :: These include full finite division and integer only division, with no remainder. The defaulting ability of numbers data in lower types to automatically be casted up to HPZ or HPQ, where specified and occuring 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, Indexing, the Window type, Record type, direct compatability with Aggregate and Window Functions, the Recursive keyword, are all parts of a larger subset that may re-interact with HPZ or HPQ. # -Mathematical and Operational functions support: precision(BIGINT input) 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 HPQ) returns HPQ; cast(HPQ as HPZ) returns HPZ; 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; 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; 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 -Ease of installation support. Particularly for Windows and Linux. *.exe, *.msi or *.rpm, *.deb, *.bin installers. With a PostgreSQL standard installation. Installation and Activation instructions included. The following chart could be used to help test trigonometry outputs, under Further Condsideration of the Unit Circle: https://co
Improved PostgreSQL Mathematics Support.
Dear PostgreSQL Hackers, I have been trying to get a reply or interest in either updating PostgreSQL to support High Precision mathematical types, with arithmetic and elementary functions support, or release of an Extension which has accomplished the same thing. Is there someone on this email list which could please have a look at the specifications that I have posted, and reply and get back to me? I would be more than thrilled if something could be done to improve PostgreSQL in this area. Yours Sincerely, Z.M.
PostgreSQL High Precision Support Extension.
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_ceilin
Re: High Precision Mathematics PostgreSQL Extension.
Dear Thomas, Is there anyone more specifically that you know, certainly on pgsql-hackers@lists.postgresql.org, that you might recommd me to? Z.M. From: Thomas Munro Sent: Thursday, 23 September 2021 1:14 PM To: A Z Subject: Re: High Precision Mathematics PostgreSQL Extension. On Thu, Sep 23, 2021 at 1:39 PM A Z wrote: > I was wondering if you have had time yet to read and think about > my most recent email about my desire to see a PostgreSQL > High Precision Base 10 Mathematics Extension developed. > > Do you know anyone who is in a position to accomplish this? Hi A Z, Not me, sorry. If it's a commercial proposition, you could perhaps try talking to one of the PostgreSQL consultancies? Or hire a student :-) I'm personally quite interested in getting DEFLOAT added to Postgres, but that's a fixed size, floating point, base 10 data type, and it's needed for standard conformance. That's probably why I read your emails to see if there was some overlap.
PostgreSQL High Precision Mathematics Extension.
I have been trying to find active interest in a free for all use PostgreSQL extension, complete and available, on the public internet, that will support the following: # High Precision Numeric and Elementary Functions Support # # In PostgreSQL v13 and beyond. # # HPPM: High Precision PostgreSQL Mathematics. # -Integer Z, or Rational Mixed Decimal Q, numbers support in 64 bit PostgreSQL. Via HPZ, and HPQ, original types. In this specification, they are collectively referred to as HPX types. There should be no range or multi range types or their supporting functions or special operators included for HPX types, at this point. -The extension could be based on a library like GMP, written in C, being an appropriate basis to use, for all OS platforms involved. The point being, that there is already some support for this extension, in terms of its logic, publicly available in C that can be apprehended for this extension and its platforms. -Real numbers are the values of Integer, non-recurring Rational Numbers and recurring, Irrational Numbers. Recurring numbers can be appropriately truncated, via a finite Natural precision value, always at least 1, to obtain an approximating value. The approximating value can really be seen as a finite Rational value, possibly with integer or decimal parts, or both together. These numbers may be positive or negative, or zero, scalar values, may be integers, decimals or mixed numbers, and always do exist on the one dimensional number line. -A defaulting number of significant figures (precision), stored inside each HPX data or type instance. This gets specified within each type variable before its use, or on data at type casting. Or a default precision is submitted instead. Precision can be accessed and changed later via precision functions. Precision is set at data casting, type declaration, or from the default, and may be altered again later. Precision is always apprehended before external or internal evaluation begins. Precision is used to control numbers, and operations involving them, and the number output, when numeric manipulation happens. If an HPX value is data on its own, without a variable or a coded expression, it takes the total default precision, if simply specified alone. If it is inserted into a table column with a different precision, then that precision is applied then. When an HPX calculated value is assigned into an HPX variable, it will try to skip ahead to the assignment variable, and take its precision from the result variable, which can be set up beforehand. If however, an HPX value, in a PostgreSQL code expression is sent straight into a RETURN statement or later, a SELECT statement, for example, then that datum will contain the highest precision value out of any of the previous values in the PostgreSQL expression which lead to it. But before anything is set or specified, a total default precision value of 20 is the beginning point. # # precision(HPZ input, BIGINT input) returns HPZ;# # precision(HPQ input, BIGINT input) returns HPQ; # # # # precision(HPZ input) returns BIGINT;# # precision(HPQ input) returns BIGINT; # # # # expression(HPZ input) returns TEXT; # # expression(HPQ input) returns TEXT;# # -HPX values, as PostgreSQL data, can be displayed, but they sit on top of a few other phenomena. Forward and inverse accuracy, withstanding truncation, can be achieved by storing, encapsulating and operating with and normalising the mathematical expression (or just one value, via assignment). The expression has one or more links, from value(s) to variable(s) in the expression, via applying of precision adjustment at evaluation time, all internally. This system will uphold any precision, certainly ones within a very large range limit, controlled by the already available type, the BIGINT. It can enumerate digits of a frequency within the range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Though naturally evaluation will slow down, or not conclude in useful time frames, before these limits. That phenomenon can be allowed, and left to the context of the programmer to deal with or avoid as they may. They may try to minimise the extent of one internal expression by using re-substitution in the body of originating, PostgreSQL, code. -- --At the point of Postgre
Advanced Questions about PostgreSQL
1) Are there free scripts for CREATE TYPE (native type), more advanced, or sorts of types out there, online, free for commercial use? With function support, too? Can someone reply with a link or a suggestion? 2) How may I get PostgreSQL to output the create table statement(s) for one or more tables inside one database, without issuing instructions via the command line, but only inside a database login, as a query or pl/sql? 3) I know that I can use COPY to import or export one database table between it and a *.csv file. Can I use it to do this with multiple TABLES and *.csv files specified in one COPY COMMAND, or not? 4) In the absence of OS command line instructions, is there an internal postgresql way, via COPY or another function for example, to backup an entire database, with all its create table statements and all insert statements, and any other associated objects as well, in one hit? Or is this ill- advised? 5) When setting up communication to remote databases on remote machines, I need to use the OPTIONS() function. It seems to require as its first function parameter, the schema of the table (the second parameter) that it wants to access. Can I supply a null schema, and still be able to reference the remote table, or must I also make use of IMPORT FOREIGN SCHEMA? 6) How may I access, query, the log for the details of a normal table, or similar? 7) I have found that the native trigonometry functions, namely the radians versions, do produce error results around key trigonometry input values. I have discovered that these errors persist, even if I cast the input parameter away from DOUBLE PRECISION and into DECIMAL. I would like to know if there are any freely available scripts out there that include Arbitrary Precision mathematical functions support that work on DECIMAL and not on DOUBLE PRECISION, that do not produce any error values around key inputs? Could someone refer me to a website that has a script that is such?