<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Am I the only one that get "semantic itch" looking at the UPDATE
expression? I would prefer it like this:</p>
<pre style="line-height:11.95pt;border:none;padding:0in"><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">UPDATE</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">nyc_neighborhoods</span></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">SET</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"><span class="gmail-p"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt">geom_invalid</span><span style="font-size:11.0pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt">=</span><span style="font-size:11.0pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">geom</span></span>,</span></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">geom</span> </span><span class="gmail-o"><span style="font-size:11.5pt;font-family:Consolas;color:#666666;letter-spacing:.2pt">=</span></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">ST_MakeValid</span><span class="gmail-p">(</span><span class="gmail-n">geom</span><span class="gmail-p">)</span></span>
</span><span style="font-size:11.0pt;font-family:Consolas;color:black;letter-spacing:.2pt"></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">WHERE</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">NOT</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">ST_IsValid</span><span class="gmail-p">(</span><span class="gmail-n">geom);</span><span class="gmail-p"></span></span></pre>
<p>where you save the original "geom" value into another column
"geom_invalid" before rectifying it and saving it into the
original column.</p>
<p>Disclaimer: I have no clue about the internal methods of the SQL
interpreter and how and in which order it assigns values.<br>
</p>
<pre class="moz-signature" cols="72">Med venlig hilsen / Kind regards
Bo Victor Thomsen</pre>
<div class="moz-cite-prefix">Den 20-04-2022 kl. 16:59 skrev Regina
Obe:<br>
</div>
<blockquote type="cite"
cite="mid:000801d854c7$32418750$96c495f0$@pcorp.us">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}span.gmail-c1
{mso-style-name:gmail-c1;}span.gmail-k
{mso-style-name:gmail-k;}span.gmail-n
{mso-style-name:gmail-n;}span.gmail-o
{mso-style-name:gmail-o;}span.gmail-p
{mso-style-name:gmail-p;}span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks
for the errata. Corrected now.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in
0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif">
postgis-users
[<a class="moz-txt-link-freetext" href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>] <b>On
Behalf Of </b>Jian He<br>
<b>Sent:</b> Wednesday, April 20, 2022 5:12 AM<br>
<b>To:</b> PostGIS Users Discussion
<a class="moz-txt-link-rfc2396E" href="mailto:postgis-users@lists.osgeo.org"><postgis-users@lists.osgeo.org></a><br>
<b>Subject:</b> [postgis-users] PostGis introduction
doc code block seems wrong....<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a
href="https://postgis.net/workshops/postgis-intro/validity.html"
moz-do-not-send="true">23. Validity —
Introduction to PostGIS</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">last code block, <o:p></o:p></p>
</div>
<div>
<div style="mso-element:para-border-div;border:solid
#CCCCCC 1.0pt;padding:6.0pt 6.0pt 6.0pt 6.0pt">
<pre style="line-height:11.95pt;border:none;padding:0in;overflow:hidden"><span class="gmail-c1"><i><span style="font-size:11.5pt;font-family:Consolas;color:#408090;letter-spacing:.2pt">-- Fix invalid and save the original</span></i></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"><o:p></o:p></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">UPDATE</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">nyc_neighborhoods</span><o:p></o:p></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">SET</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">geom</span> </span><span class="gmail-o"><span style="font-size:11.5pt;font-family:Consolas;color:#666666;letter-spacing:.2pt">=</span></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">ST_MakeValid</span><span class="gmail-p">(</span><span class="gmail-n">geom</span><span class="gmail-p">),</span><o:p></o:p></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">invalid_geom</span> </span><span class="gmail-o"><span style="font-size:11.5pt;font-family:Consolas;color:#666666;letter-spacing:.2pt">=</span></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">geom</span><o:p></o:p></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">WHERE</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">NOT</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">ST_IsValid</span><span class="gmail-p">(</span><span class="gmail-n">geom</span><span class="gmail-p">);</span><o:p></o:p></span></pre>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think it should be:<o:p></o:p></p>
</div>
<div>
<div style="mso-element:para-border-div;border:solid
#CCCCCC 1.0pt;padding:6.0pt 6.0pt 6.0pt 6.0pt">
<pre style="line-height:11.95pt;border:none;padding:0in;overflow:hidden"><span class="gmail-c1"><i><span style="font-size:11.5pt;font-family:Consolas;color:#408090;letter-spacing:.2pt">-- Fix invalid and save the original</span></i></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"><o:p></o:p></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">UPDATE</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">nyc_neighborhoods</span><o:p></o:p></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">SET</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">geom</span> </span><span class="gmail-o"><span style="font-size:11.5pt;font-family:Consolas;color:#666666;letter-spacing:.2pt">=</span></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">ST_MakeValid</span><span class="gmail-p">(</span><span class="gmail-n">geom</span><span class="gmail-p">),</span><o:p></o:p></span></pre>
<pre style="line-height:11.95pt;border:none;padding:0in"><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> geom_invalid</span><span style="font-size:11.0pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt">=</span><span style="font-size:11.0pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">geom</span></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt">
</span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">WHERE</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> </span><span class="gmail-k"><b><span style="font-size:11.5pt;font-family:Consolas;color:#007020;letter-spacing:.2pt">NOT</span></b></span><span style="font-size:11.5pt;font-family:Consolas;color:black;letter-spacing:.2pt"> <span class="gmail-n">ST_IsValid</span><span class="gmail-p">(</span><span class="gmail-n">geom</span><span class="gmail-p">);</span><o:p></o:p></span></pre>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/postgis-users">https://lists.osgeo.org/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
</body>
</html>