title: Can PgAdmin/PgScript execute an external .sql file?
body: <p>So far in my reading, the answer is NO. Am I Wrong? (I hope so!).</p>
  
  <p>I am new to PgScript (PgAdmin III). I am about to undertake a very large project of migrating an old database to a newer one. I need to write a data migration script to move data from one database to another (with different table and column names). I would like to break it up into small pieces, moving/creating, one table at a time. Each table creation and data construction to be delegated to one .sql query file per table. </p>
  
  <p>Using PgAdmin to build a single PgScript that will call each of the external .sql files in the correct order, what is the correct syntax for this in PgScript?  Can it be done? (Or is it better to use psql from a PowerShell script?)  </p>
  
  <p>Example: Os is windows
     (pseudocode in PgScript file)</p>
  
  <pre><code> do c:/some/directory/maketable1.sql;
   do c:/some/other/directory/filltable1.sql;
   etc..,..
  </code></pre>
  
  <p>Thank you for any suggestions on this.</p>