<pre><code>--- a/lib/SQL/Translator/Diff.pm
+++ b/lib/SQL/Translator/Diff.pm
@@ -272,6 +272,8 @@ sub compute_differences {
       $src_procedure_name = lc $src_procedure_name if $self-&gt;case_insensitive;
       $src_procedures_checked{$src_procedure_name} = 1;
 
+      $producer_class-&gt;create_procedure( $src_procedure )   unless $src_procedure-&gt;sql;
+      $producer_class-&gt;create_procedure( $tgt_procedure )   unless $tgt_procedure-&gt;sql;
       # Compare SQL in procedure declaration
       next unless $src_procedure-&gt;sql ne $tgt_procedure-&gt;sql;
       push @{$self-&gt;procedures_to_modify}, $tgt_procedure;
--- a/lib/SQL/Translator/Producer/PostgreSQL.pm
+++ b/lib/SQL/Translator/Producer/PostgreSQL.pm
@@ -754,6 +754,8 @@ sub create_procedure {
   }
 
   push @statements, $sql;
+  $procedure-&gt;sql( $sql );
 
   return @statements;
 }

</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/dbsrgits/sql-translator/issues/82#issuecomment-275366820">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AASeApTbyUxBKST9OGsDz31EBwU3ocndks5rWIL6gaJpZM4Isz-E">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AASeAqlueo3oxhT0Cxlv-_2Za7k2bD6lks5rWIL6gaJpZM4Isz-E.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/dbsrgits/sql-translator/issues/82#issuecomment-275366820"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/dbsrgits/sql-translator","title":"dbsrgits/sql-translator","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/dbsrgits/sql-translator"}},"updates":{"snippets":[{"icon":"PERSON","message":"@KES777 in #82: ```\r\n--- a/lib/SQL/Translator/Diff.pm\r\n+++ b/lib/SQL/Translator/Diff.pm\r\n@@ -272,6 +272,8 @@ sub compute_differences {\r\n       $src_procedure_name = lc $src_procedure_name if $self-\u003ecase_insensitive;\r\n       $src_procedures_checked{$src_procedure_name} = 1;\r\n \r\n+      $producer_class-\u003ecreate_procedure( $src_procedure )   unless $src_procedure-\u003esql;\r\n+      $producer_class-\u003ecreate_procedure( $tgt_procedure )   unless $tgt_procedure-\u003esql;\r\n       # Compare SQL in procedure declaration\r\n       next unless $src_procedure-\u003esql ne $tgt_procedure-\u003esql;\r\n       push @{$self-\u003eprocedures_to_modify}, $tgt_procedure;\r\n--- a/lib/SQL/Translator/Producer/PostgreSQL.pm\r\n+++ b/lib/SQL/Translator/Producer/PostgreSQL.pm\r\n@@ -754,6 +754,8 @@ sub create_procedure {\r\n   }\r\n \r\n   push @statements, $sql;\r\n+  $procedure-\u003esql( $sql );\r\n \r\n   return @statements;\r\n }\r\n\r\n```"}],"action":{"name":"View Issue","url":"https://github.com/dbsrgits/sql-translator/issues/82#issuecomment-275366820"}}}</script>