<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =
"urn:schemas-microsoft-com:office:office"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2737.800" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Tahoma size=2><FONT face="Times New Roman" size=3>I haven’t
received any feedback on my previous notes regarding this problem, so I updated
my system to the latest version levels and still get the same error
messages:</FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Postgis
0.8.2,</SPAN><FONT face="Times New Roman" size=3> </FONT><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Postgresql
7.4.3,</SPAN><FONT face="Times New Roman" size=3>
</FONT><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">DBI
1.43, DBD_pg 1.32, RH 9.0<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"><FONT
face="Times New Roman" size=3>I’m executing the following Postgis SQL command
and if I select the spatial object within the distance the command works, but
I get the following error message in the Postgresql log:</FONT></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="mso-tab-count: 1"><FONT face="Times New Roman"
size=3>
</FONT></SPAN><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">ERROR:<SPAN
style="mso-spacerun: yes"> </SPAN>cursor "mycursor" does not
exist<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"
size=3>When I select the spatial object out side<SPAN
class=375314018-05082004><FONT face=Arial color=#0000ff size=2> <FONT
color=#000000>and no data is found</FONT> </FONT></SPAN>the command fails
and I get the following in the Postgresql log file.</FONT></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">ERROR:<SPAN
style="mso-spacerun: yes"> </SPAN>syntax error at or near ")" at
character 144<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">LOG:<SPAN
style="mso-spacerun: yes"> </SPAN>could not send data to client:
Connection reset by peer<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">LOG:<SPAN
style="mso-spacerun: yes"> </SPAN>could not send data to client: Broken
pipe<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">LOG:<SPAN
style="mso-spacerun: yes"> </SPAN>unexpected EOF on client
connection<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">The Apache log gives
me:<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 1"> </SPAN>Premature end
of script headers:<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT
face="Times New Roman"> <o:p></o:p></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT
face="Times New Roman">If<SPAN style="mso-spacerun: yes"> </SPAN>I copy
either SQLcommand<SPAN style="mso-spacerun: yes"> </SPAN>and execute it
in psql it runs fine. With no error messages in the postgresql log file.<SPAN
style="mso-spacerun: yes"> <SPAN class=375314018-05082004><FONT
face=Arial size=2> I also have this same command in PostGis 0.7.4 and
postgresql 7.3.2 and it works fine.</FONT></SPAN></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT face=Arial
color=#0000ff size=2><SPAN style="mso-spacerun: yes"><SPAN
class=375314018-05082004></SPAN></SPAN></FONT></FONT><FONT size=3><FONT
face="Times New Roman"><SPAN style="mso-spacerun: yes"><SPAN
class=375314018-05082004></SPAN></SPAN></FONT></FONT> </P><FONT
size=3><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes"><SPAN
class=375314018-05082004>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"
size=3>Please let me know if I need to provide any other information to help
debug the program. </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT
face="Times New Roman"> <o:p></o:p></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"
size=3>This is a very common PostGis command and was curious if anybody else
is getting an empty array back if no items are found within the circular
boundary<SPAN class=375314018-05082004><FONT face=Arial size=2> with no
errors in the logfile</FONT></SPAN>?</FONT></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt"></SPAN></SPAN></FONT></FONT><FONT size=3><FONT
face="Times New Roman"> <o:p></o:p></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"
size=3>Below is the code snippet</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"
size=3>++++++++++++++++++++++++++++++++++++++++</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">$SQLcommand=qq(</SPAN><FONT
face="Times New Roman" size=3>SELECT layer, ncpin, mapsheet, ownername, addr1,
addr2, addr3, city, state, zip, book, page, value, acreage, pflag, revalue,
market<SPAN style="mso-spacerun: yes"> </SPAN>FROM<SPAN
style="mso-spacerun: yes"> </SPAN>jccondo WHERE the_geom &&
GeometryFromText('BOX3D(2103178.38307993 558215.2516,2173267.36692007
611928.4437)',1) AND Distance(GeometryFromText('POINT(2170383.04659743
579103.715194444)',1),the_geom) < 1401.77967680279);</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT
face="Times New Roman"> <o:p></o:p></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"
size=3>eval {</FONT></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">my $stmt =
$dbh->prepare($SQLcommand) ||<SPAN style="mso-spacerun: yes">
</SPAN>&AppletMsg("The table name doesn't exist or one of the attribute
names are not valid... $GisDataSrc","error");<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">};<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">if ($@)
{<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&AppletMsg("The table
name doesn't exist or one of the attribute names are not valid... <A
href="mailto:$@%22,%22error">$@","error</A>");<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">eval {<SPAN
style="mso-tab-count: 1">
</SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">$stmt->execute()
or<SPAN style="mso-spacerun: yes"> </SPAN>&AppletMsg("Can't execute
select items on $GisDataSrc - $DBI::errstr ","error");<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">};<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">if ($@)
{<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&AppletMsg("Can't
execute select items... <A
href="mailto:$@%22,%22error">$@","error</A>");<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">$colctr=1;<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 1">
</SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">while (@tname =
($stmt->fetchrow_array())) {<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 1"> </SPAN>foreach $value
(@tname) {<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 2">
</SPAN>if<SPAN style="mso-spacerun: yes"> </SPAN>($colctr ==
$NumAttrItems+1 ){<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 3">
</SPAN>$ItemNum++;<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 3">
</SPAN>$colctr=1;<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 2">
</SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 2">
</SPAN>$QueryResultsmatrix[$ItemNum]->[$colctr]=$value<SPAN
style="mso-tab-count: 5">
</SPAN>$colctr++;<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-tab-count: 1">
</SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">$stmt->finish();<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">++++++++++++++++++++++++++++++++++<SPAN
class=375314018-05082004><FONT face=Arial
color=#0000ff> </FONT></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN
class=375314018-05082004></SPAN></SPAN> </P>
<P class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><FONT
face="Times New Roman" size=3>Thanks in advance for your
help.</FONT></P></FONT></DIV></BLOCKQUOTE></BODY></HTML>