point(lseg,lseg) does not exist

Started by Shaneover 20 years ago3 messagesgeneral
Jump to latest
#1Shane
shane-pgsql@cm.nu

Hi,

I am attempting a query using lseg values to find the point
of intersection. The following query taken from the PG
manual isn't working over here.

select
point(lseg '((-1,0),(1,0))', lseg
'((-2,-2),(2,2))')
ERROR: function point(lseg, lseg) does not exist
HINT: No function matches the given name and argument
types. You may need to add explicit type casts.

Do I need to declare this function somewhere? Pg version
7.4.7 (debian rev 6 Sarge).

Best regards,
Shane

--
Shane Wegner
http://www.cm.nu/~shane/

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Shane (#1)
Re: point(lseg,lseg) does not exist

Shane <shane-pgsql@cm.nu> writes:

I am attempting a query using lseg values to find the point
of intersection. The following query taken from the PG
manual isn't working over here.

select
point(lseg '((-1,0),(1,0))', lseg
'((-2,-2),(2,2))')
ERROR: function point(lseg, lseg) does not exist

Hm, seems to be a thinko in the documentation. The function you
actually want is lseg_interpt(), which would probably be better
invoked via the documented operator lseg # lseg.

regards, tom lane

#3Don Isgitt
djisgitt@soundenergy.com
In reply to: Shane (#1)
Re: point(lseg,lseg) does not exist

Shane wrote:

Hi,

I am attempting a query using lseg values to find the point
of intersection. The following query taken from the PG
manual isn't working over here.

select
point(lseg '((-1,0),(1,0))', lseg
'((-2,-2),(2,2))')
ERROR: function point(lseg, lseg) does not exist
HINT: No function matches the given name and argument
types. You may need to add explicit type casts.

Do I need to declare this function somewhere? Pg version
7.4.7 (debian rev 6 Sarge).

Best regards,
Shane

Shane,

The operator for determining the intersection of two lsegs is #; thus,

select lseg # lseg

and the result is the intersection point.

Don