[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] ST_X does not exist in an update statement
From:       Denis Rouzaud <denis.rouzaud () gmail ! com>
Date:       2017-07-18 14:21:27
Message-ID: CAMtsY+YYchyG3VLE9E0mrb=yaAKTmbgJ82Tn-=aVH_k9GO0Gug () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Giuseppe,

Thanks a lot for your reply.
Using lower case st_x was ok.... ST_X was not working in the update
statement.
That sounds quite weird to me.

Thanks a lot for the explanation, it does bring explanation!

Cheers,
Denis

Le mar. 18 juil. 2017 Ã  15:53, Giuseppe Broccolo <g.broccolo.7@gmail.com> a
écrit :

> Hi Denis,
> 
> 2017-07-18 11:51 GMT+02:00 Denis Rouzaud <denis.rouzaud@gmail.com>:
> 
> > Hi all,
> > 
> > I'm bumbing my head against the wall.
> > 
> > I have an error "function  st_x(geometry) does not exist" in an update
> > statement which I don't understand. If I copy the same exact line in a
> > select statement I get no error...
> > 
> > Here is the update statement:
> > 
> > update qwat_od.network_element set
> > label_1_x =
> > ST_X(ST_GeomFromEWKB(ST_Fineltra(ST_SetSRID(ST_MakePoint(label_1_x,label_1_y),21781),
> >  'chenyx06.chenyx06_triangles', 'the_geom_lv03', 'the_geom_lv95')))
> > where label_1_x is not null;
> > 
> > and the select statement:
> > 
> > select
> > ST_X(ST_GeomFromEWKB(ST_Fineltra(ST_SetSRID(ST_MakePoint(label_1_x,label_1_y),21781),
> >  'chenyx06.chenyx06_triangles', 'the_geom_lv03', 'the_geom_lv95')))
> > from qwat_od.network_element
> > where label_1_x is not null;
> > 
> > 
> > How come that the select succees while not the update???
> > 
> 
> It looks like you are out of scope during the update execution, I mean, it
> looks like the update is not able to identify the schema where PostGIS
> functions and operators are defined. If this is the case, you could try to
> fully-qualify the function during its execution
> 
> [...]
> set label_1_x =
> <schema>.ST_X(<schema>.ST_GeomFromEWKB(<schema>.ST_Fineltra(<schema>.ST_SetSRID(<schema>.ST_MakePoint(label_1_x,label_1_y),21781),
>  'chenyx06.chenyx06_triangles', 'the_geom_lv03', 'the_geom_lv95')))
> [...]
> 
> where <schema> is the name of the schema where PostGIS functions are
> defined - note, you probably need to fully-qualify the rest of the
> functions.
> 
> You can check the schema through the psql command \df.
> 
> Hope this help,
> Giuseppe.
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users


[Attachment #5 (text/html)]

<div dir="ltr">Hi Giuseppe,<div><br></div><div>Thanks a lot for your \
reply.</div><div>Using lower case st_x was ok.... ST_X was not working in the update \
statement.</div><div>That sounds quite weird to me.</div><div><br></div><div>Thanks a \
lot for the explanation, it does bring \
explanation!</div><div><br></div><div>Cheers,</div><div>Denis</div></div><br><div \
class="gmail_quote"><div dir="ltr">Le  mar. 18 juil. 2017 Ã   15:53, Giuseppe \
Broccolo &lt;<a href="mailto:g.broccolo.7@gmail.com">g.broccolo.7@gmail.com</a>&gt; a \
écrit  :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi \
Denis,<br><div><div class="gmail_extra"><br><div \
class="gmail_quote"></div></div></div></div><div dir="ltr"><div><div \
class="gmail_extra"><div class="gmail_quote">2017-07-18 11:51 GMT+02:00 Denis Rouzaud \
<span dir="ltr">&lt;<a href="mailto:denis.rouzaud@gmail.com" \
target="_blank">denis.rouzaud@gmail.com</a>&gt;</span>:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I&#39;m \
bumbing my head against the wall.</div><div><br></div><div>I have an error \
&quot;function   st_x(geometry) does not exist&quot; in an update statement which I \
don&#39;t understand. If I copy the same exact line in a select statement I get no \
error...</div><div><br></div><div>Here is the update \
statement:</div><div><br></div><div><div>update qwat_od.network_element set  \
</div><div><span style="white-space:pre-wrap">	</span>label_1_x = \
ST_X(ST_GeomFromEWKB(ST_Fineltra(ST_SetSRID(ST_MakePoint(label_1_x,label_1_y),21781), \
&#39;chenyx06.chenyx06_triangles&#39;, &#39;the_geom_lv03&#39;, \
&#39;the_geom_lv95&#39;)))</div><div>where label_1_x is not \
null;</div></div><div><br></div><div>and the select \
statement:</div><div><br></div><div><div>select \
ST_X(ST_GeomFromEWKB(ST_Fineltra(ST_SetSRID(ST_MakePoint(label_1_x,label_1_y),21781), \
&#39;chenyx06.chenyx06_triangles&#39;, &#39;the_geom_lv03&#39;, \
&#39;the_geom_lv95&#39;)))</div><div>from qwat_od.network_element</div><div>where \
label_1_x is not null;</div></div><div><br></div><div><br></div><div>How come that \
the select succees while not the \
update???<br></div></div></blockquote><div><br></div></div></div></div></div><div \
dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div>It looks like \
you are out of scope during the update execution, I mean, it looks like the update is \
not able to identify the schema where PostGIS functions and operators are defined. If \
this is the case, you could try to fully-qualify the function during its \
execution<br><br>[...]<br></div><div>set <span \
style="white-space:pre-wrap"></span>label_1_x = \
&lt;schema&gt;.ST_X(&lt;schema&gt;.ST_GeomFromEWKB(&lt;schema&gt;.ST_Fineltra(&lt;schema&gt;.ST_SetSRID(&lt;schema&gt;.ST_MakePoint(label_1_x,label_1_y),21781), \
&#39;chenyx06.chenyx06_triangles&#39;, &#39;the_geom_lv03&#39;, \
&#39;the_geom_lv95&#39;)))</div><div>[...]<br><br></div><div>where &lt;schema&gt; is \
the name of the schema where PostGIS functions are defined - note, you probably need \
to fully-qualify the rest of the functions.<br><br></div><div>You can check the \
schema through the psql command \df.<br><br></div><div>Hope this \
help,<br></div><div>Giuseppe.<br></div></div></div></div></div> \
_______________________________________________<br> postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" \
target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>



[Attachment #6 (text/plain)]

_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic