<div dir="ltr"><div style="font-family:arial,sans-serif" class="gmail_default">Hi Olaf,</div><div style="font-family:arial,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,sans-serif" class="gmail_default">It's unlikely that a HDBC database driver will reconstruct a String query and execute that against the database. The originalQuery is simply the one you originally provided to prepare the Statement. You probably want Statement's</div><div style="font-family:arial,sans-serif" class="gmail_default">    execute :: [SqlValue] -> IO Integer</div><div style="font-family:arial,sans-serif" class="gmail_default">or</div><div style="font-family:arial,sans-serif" class="gmail_default">    executeMany :: [[SqlValue]] -> IO ()</div><div style="font-family:arial,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,sans-serif" class="gmail_default">The executeMany is intended to send a batch of prepared arguments to the database driver. However, I did note that the PostgreSQL driver for HDBC doesn't handle this efficiently. So, check the implementation for your specific backend.</div><div style="font-family:arial,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,sans-serif" class="gmail_default">    <a href="https://github.com/hdbc/hdbc-postgresql/blob/master/Database/HDBC/PostgreSQL/Statement.hsc#L207-L210">https://github.com/hdbc/hdbc-postgresql/blob/master/Database/HDBC/PostgreSQL/Statement.hsc#L207-L210</a></div><div style="font-family:arial,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,sans-serif" class="gmail_default">All that said, if you are doing a large bulk import, it could certainly be more efficient to use your database's facilities for doing bulk import. e.g.</div><div style="font-family:arial,sans-serif" class="gmail_default"><a href="https://www.postgresql.org/docs/current/sql-copy.html">https://www.postgresql.org/docs/current/sql-copy.html</a></div><div style="font-family:arial,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,sans-serif" class="gmail_default">You might also find that you are better off using an alternative to HDBC for your specific dbms, depending on the performance you require and whether executeMany is implemented efficiently in the HDBC driver for your dbms.<br></div></div>