pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Refactor geometric functions and operators
3+ messages / 3 participants
[nested] [flat]
* pgsql: Refactor geometric functions and operators
@ 2018-07-29 00:43 Tomas Vondra <tomas.vondra@postgresql.org>
2018-07-29 14:59 ` Re: pgsql: Refactor geometric functions and operators Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 3+ messages in thread
From: Tomas Vondra @ 2018-07-29 00:43 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Refactor geometric functions and operators
The primary goal of this patch is to eliminate duplicate code and share
code between different geometric data types more often, to prepare the
ground for additional patches. Until now the code reuse was limited,
probably because the simpler types (line and point) were implemented
after the more complex ones.
The changes are quite extensive and can be summarised as:
* Eliminate SQL-level function calls.
* Re-use more functions to implement others.
* Unify internal function names and signatures.
* Remove private functions from geo_decls.h.
* Replace should-not-happen checks with assertions.
* Add comments describe for various functions.
* Remove some unreachable code.
* Define delimiter symbols of line datatype like the other ones.
* Remove the GEODEBUG macro and printf() calls.
* Unify code style of a few oddly formatted lines.
While the goal was to cause minimal user-visible changes, it was not
possible to keep the original behavior in all cases - for example when
handling NaN values, or when reusing code makes the functions return
consistent results.
Author: Emre Hasegeli
Reviewed-by: Kyotaro Horiguchi, me
Discussion: https://www.postgresql.org/message-id/CAE2gYzxF7-5djV6-cEvqQu-fNsnt%3DEqbOURx7ZDg%2BVv6ZMTWbg%40mail...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a7dc63d904a6044d299aebdf59ad3199b6a9e99d
Modified Files
--------------
src/backend/utils/adt/geo_ops.c | 1882 +++++++++++++++++-------------------
src/backend/utils/adt/geo_spgist.c | 3 +-
src/include/utils/geo_decls.h | 4 -
src/test/regress/regress.c | 7 +-
4 files changed, 870 insertions(+), 1026 deletions(-)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Refactor geometric functions and operators
2018-07-29 00:43 pgsql: Refactor geometric functions and operators Tomas Vondra <tomas.vondra@postgresql.org>
@ 2018-07-29 14:59 ` Michael Paquier <michael@paquier.xyz>
2018-07-29 15:21 ` Re: pgsql: Refactor geometric functions and operators Tomas Vondra <tomas.vondra@2ndquadrant.com>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Paquier @ 2018-07-29 14:59 UTC (permalink / raw)
To: Tomas Vondra <tomas.vondra@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org
On Sun, Jul 29, 2018 at 12:43:29AM +0000, Tomas Vondra wrote:
> Refactor geometric functions and operators
>
> The primary goal of this patch is to eliminate duplicate code and share
> code between different geometric data types more often, to prepare the
> ground for additional patches. Until now the code reuse was limited,
> probably because the simpler types (line and point) were implemented
> after the more complex ones.
It looks that this commit has upset a couple of OSX animals, locus and
prairiedog:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=locust&dt=2018-07-29%2013%3A13%3A35
Some AIX animals are also upset for the same reason with the handling
of a negative sign with 0.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Refactor geometric functions and operators
2018-07-29 00:43 pgsql: Refactor geometric functions and operators Tomas Vondra <tomas.vondra@postgresql.org>
2018-07-29 14:59 ` Re: pgsql: Refactor geometric functions and operators Michael Paquier <michael@paquier.xyz>
@ 2018-07-29 15:21 ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
0 siblings, 0 replies; 3+ messages in thread
From: Tomas Vondra @ 2018-07-29 15:21 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; Tomas Vondra <tomas.vondra@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org
On 07/29/2018 04:59 PM, Michael Paquier wrote:
> On Sun, Jul 29, 2018 at 12:43:29AM +0000, Tomas Vondra wrote:
>> Refactor geometric functions and operators
>>
>> The primary goal of this patch is to eliminate duplicate code and share
>> code between different geometric data types more often, to prepare the
>> ground for additional patches. Until now the code reuse was limited,
>> probably because the simpler types (line and point) were implemented
>> after the more complex ones.
>
> It looks that this commit has upset a couple of OSX animals, locus and
> prairiedog:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=locust&dt=2018-07-29%2013%3A13%3A35
>
> Some AIX animals are also upset for the same reason with the handling
> of a negative sign with 0.
Yeah, the commit broke this by inadvertedly undoing 43fe90f66a0 :-(
I've posted a fix to hackers [1]. If someone with access to an affected
machine could test if it actually does the trick, that would be nice.
[1]
https://www.postgresql.org/message-id/2fce5d35-2f07-8d72-42ec-81ed97fbe640%402ndquadrant.com
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-07-29 15:21 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-29 00:43 pgsql: Refactor geometric functions and operators Tomas Vondra <tomas.vondra@postgresql.org>
2018-07-29 14:59 ` Michael Paquier <michael@paquier.xyz>
2018-07-29 15:21 ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
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