<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic PostgreSQL function: is it a bug? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/PostgreSQL-function-is-it-a-bug/m-p/324982#M57438</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a problem with queries on a PostgreSQL database using the JMP query builder...&lt;BR /&gt;Indeed some PostgreSQL functions seem not working properly in the query builder...&lt;/P&gt;&lt;P&gt;For example if I want to retrieve part of a string from the position of one of the character:&lt;BR /&gt;this command could ben written in PostgreSQL:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT&lt;/STRONG&gt; &lt;STRONG&gt;substring&lt;/STRONG&gt;('Thomas' &lt;STRONG&gt;from&lt;/STRONG&gt; &lt;STRONG&gt;position&lt;/STRONG&gt;('h' &lt;STRONG&gt;in&lt;/STRONG&gt; 'Thomas') &lt;STRONG&gt;for&lt;/STRONG&gt; 2) &lt;STRONG&gt;AS&lt;/STRONG&gt; bug_test&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;But if I write it in "add computed column" in the JMP query builder with the SQL formula editor:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;substring('Thomas' from position('h' in 'Thomas') for 2)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bug2.png" style="width: 392px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27559i482455938FBEFFD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="bug2.png" alt="bug2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;whereas this same command is well executed if I write it by hand in SQL Custom:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bug3.png" style="width: 174px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27560iC8B18BFE840CA0BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="bug3.png" alt="bug3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And in that case it is translated in jsl like other SQL command...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bug4.png" style="width: 489px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27561iEF57127C0CF35811/image-size/large?v=v2&amp;amp;px=999" role="button" title="bug4.png" alt="bug4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I don't understand is that I can sometimes write complex formulas in query builder's "computed columns" that are in pure PostgreSQL syntax and everything works fine! Like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bug5.png" style="width: 449px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27562i717B67EDA25F996A/image-size/large?v=v2&amp;amp;px=999" role="button" title="bug5.png" alt="bug5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This computed column works fine and return no error message. It is however a specific postgresql code...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a known bug on some PostgreSQL functions? How to work around it?&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Franck&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 23:41:07 GMT</pubDate>
    <dc:creator>Franck_R</dc:creator>
    <dc:date>2023-06-09T23:41:07Z</dc:date>
    <item>
      <title>PostgreSQL function: is it a bug?</title>
      <link>https://community.jmp.com/t5/Discussions/PostgreSQL-function-is-it-a-bug/m-p/324982#M57438</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a problem with queries on a PostgreSQL database using the JMP query builder...&lt;BR /&gt;Indeed some PostgreSQL functions seem not working properly in the query builder...&lt;/P&gt;&lt;P&gt;For example if I want to retrieve part of a string from the position of one of the character:&lt;BR /&gt;this command could ben written in PostgreSQL:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT&lt;/STRONG&gt; &lt;STRONG&gt;substring&lt;/STRONG&gt;('Thomas' &lt;STRONG&gt;from&lt;/STRONG&gt; &lt;STRONG&gt;position&lt;/STRONG&gt;('h' &lt;STRONG&gt;in&lt;/STRONG&gt; 'Thomas') &lt;STRONG&gt;for&lt;/STRONG&gt; 2) &lt;STRONG&gt;AS&lt;/STRONG&gt; bug_test&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;But if I write it in "add computed column" in the JMP query builder with the SQL formula editor:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;substring('Thomas' from position('h' in 'Thomas') for 2)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bug2.png" style="width: 392px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27559i482455938FBEFFD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="bug2.png" alt="bug2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;whereas this same command is well executed if I write it by hand in SQL Custom:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bug3.png" style="width: 174px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27560iC8B18BFE840CA0BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="bug3.png" alt="bug3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And in that case it is translated in jsl like other SQL command...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bug4.png" style="width: 489px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27561iEF57127C0CF35811/image-size/large?v=v2&amp;amp;px=999" role="button" title="bug4.png" alt="bug4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I don't understand is that I can sometimes write complex formulas in query builder's "computed columns" that are in pure PostgreSQL syntax and everything works fine! Like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bug5.png" style="width: 449px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27562i717B67EDA25F996A/image-size/large?v=v2&amp;amp;px=999" role="button" title="bug5.png" alt="bug5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This computed column works fine and return no error message. It is however a specific postgresql code...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a known bug on some PostgreSQL functions? How to work around it?&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Franck&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:41:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/PostgreSQL-function-is-it-a-bug/m-p/324982#M57438</guid>
      <dc:creator>Franck_R</dc:creator>
      <dc:date>2023-06-09T23:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: PostgreSQL function: is it a bug?</title>
      <link>https://community.jmp.com/t5/Discussions/PostgreSQL-function-is-it-a-bug/m-p/325025#M57445</link>
      <description>&lt;P&gt;Add Computed Column has a list of some extensions that it will support for database specific SQL, but postgresql is not one of them.&amp;nbsp; By default you probably are getting Generic SQL in the dropdown at the upper left of the formula editor.&amp;nbsp; There are some extensions supported for Oracle, MySQL, SQL Server, SAS etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We will need to consider a postgresql specific extension set for a future version of JMP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian Corcoran&lt;/P&gt;
&lt;P&gt;JMP Development&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 12:40:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/PostgreSQL-function-is-it-a-bug/m-p/325025#M57445</guid>
      <dc:creator>briancorcoran</dc:creator>
      <dc:date>2020-10-22T12:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: PostgreSQL function: is it a bug?</title>
      <link>https://community.jmp.com/t5/Discussions/PostgreSQL-function-is-it-a-bug/m-p/325029#M57446</link>
      <description>&lt;P&gt;Hello Brian&lt;/P&gt;&lt;P&gt;Thanks for your answer&lt;/P&gt;&lt;P&gt;What is strange for me is that for example the "lpad" or "to char" functions are specific syntax from PostgreSQL, not some generic SQL or Oracle SQL,... and works very well:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;t2.lot_id || '-' || lpad(to_char(t2.wafer_nr, 'FM999'), 2, '0')&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 12:56:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/PostgreSQL-function-is-it-a-bug/m-p/325029#M57446</guid>
      <dc:creator>Franck_R</dc:creator>
      <dc:date>2020-10-22T12:56:00Z</dc:date>
    </item>
  </channel>
</rss>

