Mathematical Functions and Operators

Started by Marcos Pegoraroabout 2 years ago4 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t50374
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 27, 2026 at 11:18 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t50374_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t50374_1 && git checkout t50374_1

Patchset v1 (message #1) is on t50374_1

Jump to latest
#1Marcos Pegoraro
marcos@f10.com.br

Exponentiation, Square root and Cube root operators are not formatted with
<replaceable> tag like others.

https://www.postgresql.org/docs/current/functions-math.html

regards
Marcos

Attachments:

t50374_1
patch.diffapplication/octet-stream; name=patch.diffDownload+8-8
#2Marcos Pegoraro
marcos@f10.com.br
In reply to: Marcos Pegoraro (#1)
Re: Mathematical Functions and Operators

Em qua., 9 de out. de 2024 às 16:16, Marcos Pegoraro <marcos@f10.com.br>
escreveu:

Exponentiation, Square root and Cube root operators are not formatted with
<replaceable> tag like others.

Paying more attention, there is no standard on any of those Comparison,
String, Math, Date/Time and so on functions and operators tables. What
format should it be ?
Only datatypes should use <replaceable> ?
Shouldn't function names use <replaceable> too ?

regards
marcos

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: Marcos Pegoraro (#2)
Re: Mathematical Functions and Operators

On Wednesday, October 9, 2024, Marcos Pegoraro <marcos@f10.com.br> wrote:

Shouldn't function names use <replaceable> too ?

Replaceable means the user is expected to substitute an expression in that
location. One cannot specify a function name using an expression.

David J.

#4Marcos Pegoraro
marcos@f10.com.br
In reply to: David G. Johnston (#3)
Re: Mathematical Functions and Operators

Em qua., 9 de out. de 2024 às 18:23, David G. Johnston <
david.g.johnston@gmail.com> escreveu:

Replaceable means the user is expected to substitute an expression in that
location. One cannot specify a function name using an expression.

Sorry, I thought function parameters but said names. So, function params
should have <replaceable> too ?
If you see JSON functions there are functions that their params have
<replaceable> tag

json_array ( [ *query_expression* ] [ RETURNING *data_type* [ FORMAT
JSON [ ENCODING
UTF8 ] ] ])
json_scalar ( *expression* )
json_serialize ( *expression* [ FORMAT JSON [ ENCODING UTF8 ] ] [ RETURNING
*data_type* [ FORMAT JSON [ ENCODING UTF8 ] ] ] )

they are fine, but a lot of others don't

to_json ( anyelement ) → json
json_object ( text[] ) → json

regars
Marcos