title: multiple column copy format postgresql Node.js
body: <p>I using postgres stream to insert record into postgres ,
  for single column works fine , but what is ideal data format for copy for multiple columns</p>
  
  <p>code snippets</p>
  
  <pre><code>  var sqlcopysyntax = 'COPY srt (starttime, endtime) FROM STDIN  delimiters E\'\\t\'';
  
          var stream = client.query(copyFrom(sqlcopysyntax));
  
          console.log(sqlcopysyntax)
  
  
          var interndataset = [
              ['1', '4'],
              ['6', '12.074'],
              ['13.138', '16.183'],
              ['17.226', '21.605'],
              ['22.606', '24.733'],
              ['24.816', '27.027'],
              ['31.657', '33.617'],
              ['34.66', '37.204'],
              ['37.287', '38.58'],
              ['39.456', '43.669'],
              ['43.752', '47.297'],
              ['47.381', '49.55'],
  
  
          ];
  
          var started = false;
          var internmap = through2.obj(function(arr, enc, cb) {
  /* updated this part by solution provided by @VaoTsun */            
  var rowText = arr.map(function(item) { return (item.join('\t') + '\n') }).join('') 
                  started = true;
                  //console.log(rowText)
                  rowText=rowText+'\\\.';
   /* end here*/
              started = true;
  
              cb(null, rowText);
          })
  
          internmap.write(interndataset);
          internmap.end();
  
          internmap.pipe(stream);
  </code></pre>
  
  <p>wherein i got error: (due to delimiter)missing data for column "endtime"(resolved) but got below error </p>
  
  <pre><code>error: end-of-copy marker corrupt
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lhprH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lhprH.png" alt="enter image description here"></a></p>
  
  <pre><code>COPY intern (starttime, endtime) FROM STDIN
  1                       4
  6                       12.074
  13.138                  16.183
  17.226                  21.605
  22.606                  24.733
  24.816                  27.027
  31.657                  33.617
  34.66                   37.204
  37.287                  38.58
  39.456                  43.669
  43.752                  47.297
  47.381                  49.55
  </code></pre>
  
  <p>any pointer on how to resolve this .
  what would be  ideal format for multiple column inserts using copy command </p>