<p>I tend to use PK cols which are named after the table e.g. table 'foos' has PK 'foos_id'. When renaming tables via ::Diff <code>-&gt;extra( renamed_from =&gt; 'foos'</code> then I get one of two possible breakages:</p>

<ul class="task-list">
<li>if renamed_from is used on the column as well then I get:</li>
</ul><pre><code>Can't alter field in another table at .../SQL/Translator/Producer/PostgreSQL.pm line 769.
</code></pre>

<ul class="task-list">
<li>if I skip the renamed_from on the PK (not a good idea in reality but an interesting test) then ::Diff gives a table rename followed by a DROP COLUMN on the table that no longer exists.</li>
</ul><p>The following test is currently setup for the 2nd scenario but can also be used to test the first one by removing comments from the 2 obvious lines:<br><a href="https://github.com/SysPete/sql-translator/blob/fixes/postgresql_table_renamed_from/t/pgsql-table-renamed-from.t">pgsql-table-renamed-from.t</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/dbsrgits/sql-translator/issues/40">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/302594__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMDUzNDQ4MSwiZGF0YSI6eyJpZCI6MzY1ODc4MjJ9fQ==--2a5b89d564156936cd107158b55e2c71bd7d66f9.gif" width="1" /></p>