<p>Running</p>
<div class="highlight"><pre>sqlt -f DBI --dsn <span class="s1">'dbi:Pg:host=<host>;dbname=<dbname>'</span> --db-user <db-user> -t Dumper --producer-dsn <span class="s1">'dbi:Pg:host=<host>;dbname=<dbname>'</span> --producer-db-user <db-user> > dumper.pl
perl dumper.pl --no-comments --add-truncate > dbname.data.sql
</pre></div>
<p>results in </p>
<pre lang="plain"><code>DBD::Pg::st execute failed: ERROR: syntax error at or near "desc"
LINE 1: select id, create_time, update_time, name, desc, form_values...
^ at dumper.pl line 1665.
DBD::Pg::st execute failed: ERROR: syntax error at or near "desc"
LINE 1: select id, create_time, update_time, name, desc, form_values...
^ at dumper.pl line 1665.
</code></pre>
<p>This is mainly due to columns named "desc" in tables. Quoting the column names in the SELECT statement cures this. Whether this is a fix for all database engines I'm not sure.</p>
<p>Additionally timestamp and bytea fields are output as data type numbers, but this fails on loading into MySQL.</p>
<pre lang="plain"><code>ERROR 1064 (42000) at line 205: You have an error in your SQL syntax;
</code></pre>
<p>This patch fixes both of these "features".</p>
<hr>
<h4>You can merge this Pull Request by running:</h4>
<pre> git pull https://github.com/kiwiroy/sql-translator sql_keyword_field_types</pre>
<p>Or view, comment on, or merge it at:</p>
<p> <a href='https://github.com/dbsrgits/sql-translator/pull/25'>https://github.com/dbsrgits/sql-translator/pull/25</a></p>
<h4>Commit Summary</h4>
<ul>
<li>correct quoting of timestamp fields in output and keyword fields in s…</li>
<li>add bytea to the datatypes that map to string and are hence quoted</li>
</ul>
<h4>File Changes</h4>
<ul>
<li><strong>M</strong> lib/SQL/Translator/Producer/Dumper.pm (4)</li>
</ul>
<h4>Patch Links</h4>
<ul>
<li><a href='https://github.com/dbsrgits/sql-translator/pull/25.patch'>https://github.com/dbsrgits/sql-translator/pull/25.patch</a></li>
<li><a href='https://github.com/dbsrgits/sql-translator/pull/25.diff'>https://github.com/dbsrgits/sql-translator/pull/25.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">
—<br>
Reply to this email directly or <a href='https://github.com/dbsrgits/sql-translator/pull/25'>view it on GitHub</a>.
</p>
<img src='https://github.com/notifications/beacon/4W3BWTo7EIi_7vx28Xzl_v_XpCnrBD-G5iVBo0WfiBO5EXoHTyxN6VcBOXO7O_Zf.gif' height='1' width='1'>