<p dir="auto">When parsing indices of a table, the Parser::DBI::PostgreSQL makes an incorrect assumption that the numeric field references refer to the current column order. This breaks if the table has had any columns deleted, because Postgres does not re-number the columns, so the column (attribute ids) might be (1,2,4,6,7) and these are the numbers that need used.</p>
<p dir="auto">The code already retrieved the ids of the columns, so just store them in a hash and use them instead of the column name list.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/dbsrgits/sql-translator/pull/153'>https://github.com/dbsrgits/sql-translator/pull/153</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/dbsrgits/sql-translator/pull/153/commits/15d7d0e27a6ef4ccdf6e9aee82afae0173cbbfcd" class="commit-link">15d7d0e</a> Fix bug loading Postgres index fields</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/dbsrgits/sql-translator/pull/153/files">1 file</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/dbsrgits/sql-translator/pull/153/files#diff-74348f4ccec11c62e25f283e410627fd920191495ccd06398190b4073f154976">lib/SQL/Translator/Parser/DBI/PostgreSQL.pm</a>
(5)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/dbsrgits/sql-translator/pull/153.patch'>https://github.com/dbsrgits/sql-translator/pull/153.patch</a></li>
<li><a href='https://github.com/dbsrgits/sql-translator/pull/153.diff'>https://github.com/dbsrgits/sql-translator/pull/153.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/dbsrgits/sql-translator/pull/153">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AACJ4ARIBG7PR5NV2YVL4L3WOLY45ANCNFSM6AAAAAATFSBN6E">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AACJ4AUJYHWQ65IIZ3SKPXTWOLY45A5CNFSM6AAAAAATFSBN6GWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFTRYGJE.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><dbsrgits/sql-translator/pull/153</span><span>@</span><span>github</span><span>.</span><span>com></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/153",
"url": "https://github.com/dbsrgits/sql-translator/pull/153",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>