title: Restore Multiple Schemas in a Single Transaction - Postgres
body: <p>I have a rather large database with 5+ schemas.  Currently I am creating backups by doing a pg_dump to generate individual .sql files for each schema.  When I do a restore I am having to cycle through each schema and run a restore command individually which is time consuming and also presents issues if a particular schema were to fail.  I could run into a situation where some schemas are updated while others following a failure may not be.</p>
  
  <p>What I would like to do is run each of these restores in parallel as a single transaction so if one fails they all fail.  Also, I know the easy answer to this would be not to backup as individual .sql files, unfortunately that is a requirement I cannot change.</p>
  
  <p>Also I should note I am launching off these postgresql commands from a c# baseline.  An additional option I explored was to launch new threads for each .sql file in the restore, this doesnt solve my single transaction problem though.</p>