operator @@ is not supported by path; doc says otherwise - Mailing list pgsql-docs

From PG Doc comments form
Subject operator @@ is not supported by path; doc says otherwise
Date
Msg-id 163855517345.1269.9719037985492147759@wrigleys.postgresql.org
Whole thread Raw
List pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/functions-geometry.html
Description:

Hello,

The documentation for 13 and 14 says in "Geometric Functions and
Operators":

> @@ geometric_type → point
> Computes the center point. Available for box, lseg, path, polygon,
circle.
> @@ box '(2,2),(0,0)' → (1,1)

However, apparently, this operator doesn't work for path:

> $ psql
> psql (14.1)
> Type "help" for help.
>
> postgres=# SELECT @@ path '[(0,0),(0,1)]';
> ERROR:  function "path_center" not implemented
> postgres=#

Same for a closed path:
> postgres=# SELECT @@ path '((0,0),(0,1))';
> ERROR:  function "path_center" not implemented

Quick tests show that other types listed (box, lseg, polygon, circle) are
supported, so only the path is extra.

This sentence in the documentation came from commit 791090bd775b (included
in REL_13_STABLE and later). What slightly confuses me is that path_center
has been listed in src/include/catalog/pg_operator.dat and pg_proc.dat (and
pg_operator.h/pg_proc.h before that) since 3c2d74d2a (1997!), but since
a3d284485 (2018) we have a regression test ensuring "function "path_center"
not implemented".

The easiest fix is, obviously, removing 'path' from the list. Or, if that
would be an actual improvement, I could submit a patch to support a
path_center as well. Not sure if there is any actual need for that, though:
I found this by just goofing around, not because I actually needed to
calculate the center for some path, and converting to polygon might be a
workaround for those who might need that.

Anton Voloshin
Postgres Professional, The Russian Postgres Company
https://postgrespro.ru

pgsql-docs by date:

Previous
From: Max Ziermann
Date:
Subject: Re: Triggers on underlying tables of updatable views
Next
From: Anton Voloshin
Date:
Subject: operator @@ is not supported by path; doc says otherwise