<p dir="auto">I'm rather surprised to find bugs this large, so please review and see if I have any wrong assumptions here.</p>
<p dir="auto">I'm running into cases where postgres round-trip from a DBI connection was generating a lot of syntax errors.  It seems to have broken handling of column types with sizes, and broken handling of default values for anything other than numeric constants.</p>
<p dir="auto">The changes are maybe best described by the changes to unit test 66.  You can see that the parser used to store char column size in the data_type instead of -&gt;size field, and have an incorrect value in the -&gt;size field, and store literal DDL as plain strings for the default_value.  I changed these to behave like other parsers and put the real size in the size column, and use scalar-refs for any default value that is literal DDL.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href='https://github.com/dbsrgits/sql-translator/pull/155'>https://github.com/dbsrgits/sql-translator/pull/155</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/dbsrgits/sql-translator/pull/155/commits/ca6c4d533d6904fc60cb53b98445fa9e584e0447" class="commit-link">ca6c4d5</a>  Fix default values returned by Parser::DBI::PostgreSQL</li>
  <li><a href="https://github.com/dbsrgits/sql-translator/pull/155/commits/8241aab834e7096b8d7312a8d09cbd0380dfcf29" class="commit-link">8241aab</a>  Fix data_type and size returned by Parser::DBI::PostgreSQL</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/dbsrgits/sql-translator/pull/155/files">2&nbsp;files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/sql-translator/pull/155/files#diff-74348f4ccec11c62e25f283e410627fd920191495ccd06398190b4073f154976">lib/SQL/Translator/Parser/DBI/PostgreSQL.pm</a>
    (32)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/sql-translator/pull/155/files#diff-d6951dd1b35ef72128ea4b832080a877c6b34f3633e7395b0ba0110acc52c55a">t/66-postgres-dbi-parser.t</a>
    (26)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/dbsrgits/sql-translator/pull/155.patch'>https://github.com/dbsrgits/sql-translator/pull/155.patch</a></li>
  <li><a href='https://github.com/dbsrgits/sql-translator/pull/155.diff'>https://github.com/dbsrgits/sql-translator/pull/155.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />Reply to this email directly, <a href="https://github.com/dbsrgits/sql-translator/pull/155">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AACJ4AW4VZBQLBZJ32S7B4TWQTZ33ANCNFSM6AAAAAATQLI4RU">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AACJ4AQ4HT7JWL7E7K7QUCDWQTZ33A5CNFSM6AAAAAATQLI4RWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFU7XN4M.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span>&lt;dbsrgits/sql-translator/pull/155</span><span>@</span><span>github</span><span>.</span><span>com&gt;</span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/dbsrgits/sql-translator/pull/155",
"url": "https://github.com/dbsrgits/sql-translator/pull/155",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>