title: How to indicate in postgreSQL command in which database to execute a script? (simmilar to SQL Server "use" command)
body: <p>I have the following problem, I need to put in a script that is going to run before the new version is rolled the SQL code that enables the pgAgent in PostgreSQL. However, this code should be run on the maintenance database (postgres) and the database where we run the script file is another one.</p>
  
  <p>I remember that in SQL Server there is a command "use " so you could do something like:</p>
  
  <pre><code>use foo
  
  -- some code
  
  use bar 
  
  -- more code
  </code></pre>
  
  <p>is there something similar in PostgreSQL?</p>