pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedNon-standard function names
2+ messages / 2 participants
[nested] [flat]
* Non-standard function names
@ 2004-06-23 15:45 Clive Page <cgp@star.le.ac.uk>
2004-06-23 16:26 ` Re: Non-standard function names Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Clive Page @ 2004-06-23 15:45 UTC (permalink / raw)
To: pgsql-sql
The developers of Postgres over the years are to be commended on their
support for SQL Standards, but one thing that has annoyed me for some time
is that the names of several mathematical functions are seriously
non-standard. Postgres isn't actually flouting an SQL Standard in this
area as there isn't one as far as I can discover, but the JDBC
specification includes a number of function names, and most other DBMS use
the same ones, more-or-less. I put together a small web page comparing
the function names in use in various products:
http://wiki.astrogrid.org/bin/view/Astrogrid/DBMSmathFunctions
Here one can see that Postgres actually has 6 deviations from the de-facto
JDBC standard, more than any other DBMS I examined, while MySQL comes out
as the most conformant, surprisingly.
Four of these could be fixed easily, by allowing CEILING to be a synonym
for CEIL, and similarly POW for POWER, RAND for RANDOM, and TRUNCATE for
TRUNC. Does anyone see any problems with doing that? It would surely
help people porting applications over from other DBMS.
The problems come with LN and LOG which Postgres uses for logarithms to
base e and 10 respectively: the JDBC standard uses LOG and LOG10
respectively, so that any fix would mean LOG changed its meaning. I don't
see an easy solution here; maybe both LOGE and LOG10 could be provided, at
least there would then be only one difference from the JDBC standard.
--
Clive Page
Dept of Physics & Astronomy,
University of Leicester,
Leicester, LE1 7RH, U.K.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Non-standard function names
2004-06-23 15:45 Non-standard function names Clive Page <cgp@star.le.ac.uk>
@ 2004-06-23 16:26 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2004-06-23 16:26 UTC (permalink / raw)
To: Clive Page <cgp@star.le.ac.uk>; +Cc: pgsql-sql
Clive Page <cgp@star.le.ac.uk> writes:
> The problems come with LN and LOG which Postgres uses for logarithms to
> base e and 10 respectively: the JDBC standard uses LOG and LOG10
> respectively, so that any fix would mean LOG changed its meaning. I don't
> see an easy solution here; maybe both LOGE and LOG10 could be provided, at
> least there would then be only one difference from the JDBC standard.
loge() strikes me as pointless; you might as well just use ln().
I don't have any objections to the other proposed additions though.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-06-23 16:26 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-23 15:45 Non-standard function names Clive Page <cgp@star.le.ac.uk>
2004-06-23 16:26 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox