<?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>question Re: Upsert on conflict not quoting keys in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372568#M241283</link>
    <description>&lt;P&gt;I was finally able to reproduce the issue, looking into a fix now&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2023 20:49:43 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2023-06-13T20:49:43Z</dc:date>
    <item>
      <title>Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/355723#M237130</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using a PutDatabaseRecord with UPSERT statement for a PostgreSQL database, but the ON CONFLICT keys are not being quoted event with the setting "Quote Column Identifiers" set to true.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DGaboleiro_0-1666334332405.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36001i9CF0FF32064083CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DGaboleiro_0-1666334332405.png" alt="DGaboleiro_0-1666334332405.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR:
Batch entry 0 INSERT INTO "eventstorage"."2062d999b1f26bcb32c3f39d22bd34"(..., "FDZ_UUID", ...) VALUES (...) ON CONFLICT (FDZUUID) DO UPDATE SET (...) = (..., EXCLUDED."FDZ_UUID", ...) was aborted: ERROR: column "fdzuuid" does not exist&lt;/LI-CODE&gt;&lt;P&gt;I've seen an JIRA issue regarding this behavior and it is as Resolved: &lt;A href="https://issues.apache.org/jira/browse/NIFI-8043" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-8043&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I'm using nifi 1.17.0&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;sorry for pinging you directly, but you were the assignee of the jira ticket and I've seen you commenting other similar posts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 06:44:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/355723#M237130</guid>
      <dc:creator>DGaboleiro</dc:creator>
      <dc:date>2022-10-21T06:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/355849#M237149</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/101293"&gt;@DGaboleiro&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;That is not me as the assignee to jira&amp;nbsp;&lt;A href="https://issues.apache.org/jira/browse/NIFI-8043" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-8043&lt;/A&gt;.&amp;nbsp; But that Matt is an awesome guy&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38301"&gt;@mburgess&lt;/a&gt;.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 19:23:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/355849#M237149</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2022-10-21T19:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/359459#M238125</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38301"&gt;@mburgess&lt;/a&gt; could you give a little help in this ticket? I am still facing this issue and I'm not sure how to implement a workaroud&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 16:43:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/359459#M238125</guid>
      <dc:creator>DGaboleiro</dc:creator>
      <dc:date>2022-12-13T16:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/359842#M238220</link>
      <description>&lt;P&gt;Update: Created a custom processor by duplicating PutDatabaseRecord and added the if statement that was done in the commit &lt;A href="https://github.com/apache/nifi/pull/4772/commits/0d6bca493842286ddae6a0577dfed55cd1808f7c" target="_blank"&gt;https://github.com/apache/nifi/pull/4772/commits/0d6bca493842286ddae6a0577dfed55cd1808f7c&lt;/A&gt;. It solved the issue but I had to create a NAR with all of the bundled dependencies in nifi-standard-processors because I was having an error while starting NiFi (&lt;A href="https://community.cloudera.com/t5/Support-Questions/Nifi-throwing-error-on-startup/m-p/240893" target="_blank"&gt;https://community.cloudera.com/t5/Support-Questions/Nifi-throwing-error-on-startup/m-p/240893&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;I've checked the code base and the if statement is not present in Nifi &amp;gt; 1.12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;, since you were the only one helping and &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38301"&gt;@mburgess&lt;/a&gt; is not replying to the ticket, do you think it is possible/doable to create an hot-fix or something like that to have this commit? - I've seen more people complaining regarding this issue and it would be useful to not duplicate the source code just to add an if statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 19:25:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/359842#M238220</guid>
      <dc:creator>DGaboleiro</dc:creator>
      <dc:date>2022-12-19T19:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/359891#M238227</link>
      <description>&lt;P&gt;I wasn't able to reproduce this, I remember trying your example and the UPSERT worked for me, so I'm not sure what's going on&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 13:52:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/359891#M238227</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2022-12-20T13:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/370850#M240830</link>
      <description>&lt;P&gt;Hello, &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38301"&gt;@mburgess&lt;/a&gt;&amp;nbsp;I'm facing same issue with upsert to Postgresql.&lt;BR /&gt;My software versions:&lt;BR /&gt;NiFi version 1.19.1,&amp;nbsp;Postgresql 13,&amp;nbsp;JDBC driver: postgresql-42.5.1.jar&lt;/P&gt;&lt;P&gt;When I started to make sample flow to represent this bug, I found another one similar &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I created two tables with camelcase in table and colum names: MyTable and MyTable2 with similar columns list using queries:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;CREATE TABLE IF NOT EXISTS&lt;BR /&gt;public."MyTable" ("Id" SERIAL PRIMARY KEY, "Col1" VARCHAR(1024), "createdAt" TIMESTAMP DEFAULT NOW());&lt;/P&gt;&lt;P&gt;CREATE TABLE IF NOT EXISTS&lt;BR /&gt;public."MyTable2" ("Id" SERIAL PRIMARY KEY, "Col1" VARCHAR(1024), "createdAt" TIMESTAMP DEFAULT NOW());&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I've generated JSON and tried to put some rows in table MyTable using ConvertJSONToSQL. Here is my&amp;nbsp;ConvertJSONToSQL processor:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSONToSQL.png" style="width: 766px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37606i775B768BD8874172/image-size/large?v=v2&amp;amp;px=999" role="button" title="JSONToSQL.png" alt="JSONToSQL.png" /&gt;&lt;/span&gt;&lt;BR /&gt;And here I got a "new" bug. ConvertJSONToSQL quotes schema name along with table name.&amp;nbsp;As result I get "public.MyTable" in constructed query, and Postgres rejects it.&lt;/P&gt;&lt;LI-SPOILER&gt;INSERT INTO "public.MyTable" ("Col1") VALUES (?)&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Okay, I've inserted some rows manually in MyTable and tried to clone data using ExecuteSQL processor connected directly to PutDatabaseRecord.&lt;BR /&gt;ExecuteSql processor:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExecuteSQL.png" style="width: 762px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37607i6F67B7D152FB1441/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExecuteSQL.png" alt="ExecuteSQL.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;PutDatabaseRecord processor:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PutDatabaseRecord1.png" style="width: 765px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37608i878ADE1860AC774B/image-size/large?v=v2&amp;amp;px=999" role="button" title="PutDatabaseRecord1.png" alt="PutDatabaseRecord1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PutDatabaseRecord2.png" style="width: 768px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37609i7FE0505098E94DEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="PutDatabaseRecord2.png" alt="PutDatabaseRecord2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;PutDatabaseRecord generates correct quoting on "public"."Mytable" but does not quote key column indentifier in ON CONFLINCT clause as topic starter pointed.&lt;/P&gt;&lt;LI-SPOILER&gt;INSERT INTO "public"."MyTable2"("Id", "Col1", "createdAt")&lt;BR /&gt;VALUES (1, 'value1', '2023-05-16 08:10:56+03')&lt;BR /&gt;ON CONFLICT (ID)&lt;BR /&gt;DO UPDATE SET ("Id", "Col1", "createdAt") =&lt;BR /&gt;(EXCLUDED."Id", EXCLUDED."Col1", EXCLUDED."createdAt")&lt;/LI-SPOILER&gt;&lt;P&gt;I hope this helps to figure out how to reproduce this bug.&lt;BR /&gt;UPD:&amp;nbsp;PutDatabaseRecord also changes key colum name to uppercase.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 09:12:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/370850#M240830</guid>
      <dc:creator>LevinYI</dc:creator>
      <dc:date>2023-05-16T09:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372567#M241282</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38301"&gt;@mburgess&lt;/a&gt;&amp;nbsp;I have the same issues with Version 1.18.0 and also with 1.21.0, Do we have any solution on this one, this is breaking the upsert operation for Postgresql.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 19:29:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372567#M241282</guid>
      <dc:creator>Vasu_</dc:creator>
      <dc:date>2023-06-13T19:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372568#M241283</link>
      <description>&lt;P&gt;I was finally able to reproduce the issue, looking into a fix now&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 20:49:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372568#M241283</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2023-06-13T20:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372569#M241284</link>
      <description>&lt;P&gt;It looks like this is a regression from&amp;nbsp;&lt;A href="https://issues.apache.org/jira/browse/NIFI-9607" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-9607&lt;/A&gt;&amp;nbsp;but will need a different solution than just restoring the code changes as it would fail the behavior the aforementioned Jira was meant to fix.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 20:57:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372569#M241284</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2023-06-13T20:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Upsert on conflict not quoting keys</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372573#M241287</link>
      <description>&lt;P&gt;Tracking here:&amp;nbsp;&lt;A href="https://issues.apache.org/jira/browse/NIFI-11682" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-11682&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 21:59:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Upsert-on-conflict-not-quoting-keys/m-p/372573#M241287</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2023-06-13T21:59:47Z</dc:date>
    </item>
  </channel>
</rss>

