<?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 Re: Inserting into PostgreSQL ARRAY type in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337464#M105802</link>
    <description>Hi Rob, 
&lt;BR /&gt;This turned out to be a very useful solution for us.We have been trying to eliminate the tpostgresqlrow component and have been unsuccessful.We tried the solution suggested by you and it worked out perfectly. 
&lt;BR /&gt;Thanks.. 
&lt;BR /&gt;Sunil</description>
    <pubDate>Mon, 19 Oct 2015 09:15:39 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2015-10-19T09:15:39Z</dc:date>
    <item>
      <title>Inserting into PostgreSQL ARRAY type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337460#M105798</link>
      <description>Hi All, 
&lt;BR /&gt;We have a table containing a PostgreSQL integer[]; which we need to insert into. 
&lt;BR /&gt;With tAggregate/tMap we can create a List&amp;lt;Integer&amp;gt; however when we try to use tPostgresqlOutput we get: 
&lt;BR /&gt; 
&lt;PRE&gt;Can't infer the SQL type to use for an instance of java.util.ArrayList. Use setObject() with an explicit Types value to specify the type to use.&lt;/PRE&gt; 
&lt;BR /&gt;I'm now converting it into a string of the format '{1,2,3}' (this is an array literal in PG) with a tMap and attempting to use that in-place of the array, however we get the following error from the tPostgresqlOutput: 
&lt;BR /&gt; 
&lt;PRE&gt;ERROR: column "matrix" is of type integer[] but expression is of type character varying&lt;BR /&gt;  Hint: You will need to rewrite or cast the expression.&lt;/PRE&gt; 
&lt;BR /&gt;Does anyone have any idea how we can get this to work?! 
&lt;BR /&gt;Thanks in advance 
&lt;BR /&gt;-Rob</description>
      <pubDate>Wed, 08 Oct 2014 16:35:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337460#M105798</guid>
      <dc:creator>re_weavers</dc:creator>
      <dc:date>2014-10-08T16:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting into PostgreSQL ARRAY type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337461#M105799</link>
      <description>Hi,&lt;BR /&gt;Please use tPostgresqlRow instead of using tPostgresqlOutput to execute an insert query to insert data into PostgreSQL.&lt;BR /&gt;Let us know if it is OK with you.&lt;BR /&gt;Best regards&lt;BR /&gt;Sabrina</description>
      <pubDate>Fri, 31 Oct 2014 04:15:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337461#M105799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-31T04:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting into PostgreSQL ARRAY type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337462#M105800</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Hi,&lt;BR /&gt;Please use tPostgresqlRow instead of using tPostgresqlOutput to execute an insert query to insert data into PostgreSQL.&lt;BR /&gt;Let us know if it is OK with you.&lt;BR /&gt;Best regards&lt;BR /&gt;Sabrina&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Hey Sabrina,&lt;BR /&gt;That works, however we've found it be non-performant over WAN links when compared to tPostgresqlOutput as it seems to have an effective batch size of 1; is there a way of applying a batch size to this?&lt;BR /&gt;Many Thanks,&lt;BR /&gt;Rob</description>
      <pubDate>Thu, 20 Nov 2014 14:21:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337462#M105800</guid>
      <dc:creator>re_weavers</dc:creator>
      <dc:date>2014-11-20T14:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting into PostgreSQL ARRAY type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337463#M105801</link>
      <description>For anyone actually trying to do this; we did the following in the end: 
&lt;BR /&gt;Originally we had a tMap and tPostgresRow; and assembled the INSERT query in the tMap then flowToIterate to the tPostgresRow and used that as the query. This turned out to be very slow over some of our VPN links as the number of rows/sec is limited by the latency between the job and the server as it has to been round-tripping. 
&lt;BR /&gt;So we did the following instead: 
&lt;BR /&gt;In the mapper we replace .toString() on the ArrayList is basically JSON object formatted ',]'; so we hack the string into Postgres format '{{1,2},{3,4}}' 
&lt;BR /&gt;Then in the tPostgresqlOutput we typecast the string to the correct datatype using the advanced options (see screenies): 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBBq.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154088i6B1FAFFB2BF13AE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBBq.png" alt="0683p000009MBBq.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MB4H.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153351i9913E35970BB33F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MB4H.png" alt="0683p000009MB4H.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBBv.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136715i224A91AD5F545BDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBBv.png" alt="0683p000009MBBv.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Tue, 25 Nov 2014 12:16:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337463#M105801</guid>
      <dc:creator>re_weavers</dc:creator>
      <dc:date>2014-11-25T12:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting into PostgreSQL ARRAY type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337464#M105802</link>
      <description>Hi Rob, 
&lt;BR /&gt;This turned out to be a very useful solution for us.We have been trying to eliminate the tpostgresqlrow component and have been unsuccessful.We tried the solution suggested by you and it worked out perfectly. 
&lt;BR /&gt;Thanks.. 
&lt;BR /&gt;Sunil</description>
      <pubDate>Mon, 19 Oct 2015 09:15:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337464#M105802</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2015-10-19T09:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting into PostgreSQL ARRAY type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337465#M105803</link>
      <description>&lt;P&gt;Thank you sir! This worked like a charm.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 23:36:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Inserting-into-PostgreSQL-ARRAY-type/m-p/2337465#M105803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-03T23:36:04Z</dc:date>
    </item>
  </channel>
</rss>

