pg.ddx.io pgsql-docs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
operator @@ is not supported by path; doc says otherwise 3+ messages / 3 participants [nested] [flat]
* operator @@ is not supported by path; doc says otherwise @ 2021-12-03 18:12 PG Doc comments form <noreply@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: PG Doc comments form @ 2021-12-03 18:12 UTC (permalink / raw) To: pgsql-docs@lists.postgresql.org; +Cc: a.voloshin@postgrespro.ru 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 ^ permalink raw reply [nested|flat] 3+ messages in thread
* operator @@ is not supported by path; doc says otherwise @ 2021-12-06 16:46 Anton Voloshin <a.voloshin@postgrespro.ru> 2021-12-06 18:49 ` Re: operator @@ is not supported by path; doc says otherwise Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 1 reply; 3+ messages in thread From: Anton Voloshin @ 2021-12-06 16:46 UTC (permalink / raw) To: pgsql-docs@lists.postgresql.org Hello, The documentation for 13 and 14 says in "Geometric Functions and Operators" https://www.postgresql.org/docs/14/functions-geometry.html: > @@ 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 does not 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 791090bd775b (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 that "function "path_center" not implemented". The easiest fix is, obviously, removing 'path' from the list in the documentation. 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. Also, converting to polygon might be a workaround for those who might need that feature. Please let me know if implementing path_center would be a useful addition. P.S. I've sent a report though a submit web form on a documentation web site two days ago, but, apparently, that email was not delivered to this list. Anton Voloshin Postgres Professional, The Russian Postgres Company https://postgrespro.ru ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: operator @@ is not supported by path; doc says otherwise 2021-12-06 16:46 operator @@ is not supported by path; doc says otherwise Anton Voloshin <a.voloshin@postgrespro.ru> @ 2021-12-06 18:49 ` Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2021-12-06 18:49 UTC (permalink / raw) To: Anton Voloshin <a.voloshin@postgrespro.ru>; +Cc: pgsql-docs@lists.postgresql.org Anton Voloshin <a.voloshin@postgrespro.ru> writes: > The documentation for 13 and 14 says in "Geometric Functions and > Operators" https://www.postgresql.org/docs/14/functions-geometry.html: >>> @@ 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 does not work for path: >>> postgres=# SELECT @@ path '[(0,0),(0,1)]'; >>> ERROR: function "path_center" not implemented The fact that this operator is documented is probably my fault --- when I went through the operator tables not long ago, I made sure there was an entry for every operator listed in the system catalogs. It didn't enter my mind that some of them might be pointing at useless stubs :-(. Looking through geo_ops.c, I see that not only path_center but also dist_lb, dist_bl, close_sl, close_lb, poly_distance error out with "not implemented". Given that that code has sat there for more than 20 years with nobody coming to finish the job, I think we should just rip those functions and catalog entries out altogether. It's misleading and probably a small waste of cycles to have useless entries in pg_proc and pg_operator. regards, tom lane ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-12-06 18:49 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-12-03 18:12 operator @@ is not supported by path; doc says otherwise PG Doc comments form <noreply@postgresql.org> 2021-12-06 16:46 operator @@ is not supported by path; doc says otherwise Anton Voloshin <a.voloshin@postgrespro.ru> 2021-12-06 18:49 ` 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